mirror of
https://github.com/GSA/notifications-api.git
synced 2026-05-29 18:38:26 -04:00
Bump flake8-bugbear from 24.12.12 to 25.10.21 (#2052)
* Bump flake8-bugbear from 24.12.12 to 25.10.21 Bumps [flake8-bugbear](https://github.com/PyCQA/flake8-bugbear) from 24.12.12 to 25.10.21. - [Release notes](https://github.com/PyCQA/flake8-bugbear/releases) - [Commits](https://github.com/PyCQA/flake8-bugbear/compare/24.12.12...25.10.21) --- updated-dependencies: - dependency-name: flake8-bugbear dependency-version: 25.10.21 dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * Fix flake8-bugbear B042 violations in exception classes * Trigger CI re-run * Regenerate poetry.lock with Poetry 2.1.3 for CI compatibility * Regenerated poetry hash again --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Alex Janousek <alex.janousek@gsa.gov>
This commit is contained in:
@@ -153,7 +153,9 @@ def get_organization_services_usage(organization_id):
|
||||
return jsonify(result="error", message="No valid year provided"), 400
|
||||
include_all = request.args.get("include_all_services", "false").lower() == "true"
|
||||
|
||||
services = fetch_usage_year_for_organization(organization_id, year, include_all_services=include_all)
|
||||
services = fetch_usage_year_for_organization(
|
||||
organization_id, year, include_all_services=include_all
|
||||
)
|
||||
list_services = services.values()
|
||||
sorted_services = sorted(
|
||||
list_services, key=lambda s: (-s["active"], s["service_name"].lower())
|
||||
@@ -266,7 +268,9 @@ def send_notifications_on_mou_signed(organization_id):
|
||||
)
|
||||
|
||||
|
||||
@organization_blueprint.route("/<uuid:organization_id>/message-allowance", methods=["GET"])
|
||||
@organization_blueprint.route(
|
||||
"/<uuid:organization_id>/message-allowance", methods=["GET"]
|
||||
)
|
||||
def get_organization_message_allowance(organization_id):
|
||||
|
||||
check_suspicious_id(organization_id)
|
||||
@@ -276,11 +280,16 @@ def get_organization_message_allowance(organization_id):
|
||||
services = dao_get_organization_services(organization_id)
|
||||
|
||||
if not services:
|
||||
return jsonify({
|
||||
"messages_sent": 0,
|
||||
"messages_remaining": 0,
|
||||
"total_message_limit": 0,
|
||||
}), 200
|
||||
return (
|
||||
jsonify(
|
||||
{
|
||||
"messages_sent": 0,
|
||||
"messages_remaining": 0,
|
||||
"total_message_limit": 0,
|
||||
}
|
||||
),
|
||||
200,
|
||||
)
|
||||
|
||||
current_year = datetime.now(tz=ZoneInfo("UTC")).year
|
||||
service_ids = [service.id for service in services]
|
||||
@@ -293,8 +302,13 @@ def get_organization_message_allowance(organization_id):
|
||||
total_message_limit = sum(s.total_message_limit for s in services)
|
||||
total_messages_remaining = total_message_limit - total_messages_sent
|
||||
|
||||
return jsonify({
|
||||
"messages_sent": total_messages_sent,
|
||||
"messages_remaining": total_messages_remaining,
|
||||
"total_message_limit": total_message_limit,
|
||||
}), 200
|
||||
return (
|
||||
jsonify(
|
||||
{
|
||||
"messages_sent": total_messages_sent,
|
||||
"messages_remaining": total_messages_remaining,
|
||||
"total_message_limit": total_message_limit,
|
||||
}
|
||||
),
|
||||
200,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user