mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-02 09:26:08 -05:00
flake8 - misc flake8 errs.
* unused variables * variables in loops overshadowing imports * excepts with no defined exc type (tried to avoid `except Exception` too) * history mapper is still too complex * default variables should never be mutable
This commit is contained in:
@@ -35,7 +35,7 @@ def dao_update_annual_billing_for_current_and_future_years(service_id, free_sms_
|
||||
if not financial_year_start:
|
||||
financial_year_start = get_current_financial_year_start_year()
|
||||
|
||||
updated = AnnualBilling.query.filter(
|
||||
AnnualBilling.query.filter(
|
||||
AnnualBilling.service_id == service_id,
|
||||
AnnualBilling.financial_year_start >= financial_year_start
|
||||
).update(
|
||||
|
||||
@@ -318,22 +318,22 @@ def dao_fetch_monthly_historical_stats_for_service(service_id, year):
|
||||
)
|
||||
|
||||
months = {
|
||||
datetime.strftime(date, '%Y-%m'): {
|
||||
datetime.strftime(created_date, '%Y-%m'): {
|
||||
template_type: dict.fromkeys(
|
||||
NOTIFICATION_STATUS_TYPES,
|
||||
0
|
||||
)
|
||||
for template_type in TEMPLATE_TYPES
|
||||
}
|
||||
for date in [
|
||||
for created_date in [
|
||||
datetime(year, month, 1) for month in range(4, 13)
|
||||
] + [
|
||||
datetime(year + 1, month, 1) for month in range(1, 4)
|
||||
]
|
||||
}
|
||||
|
||||
for notification_type, status, date, count in rows:
|
||||
months[datetime.strftime(date, "%Y-%m")][notification_type][status] = count
|
||||
for notification_type, status, created_date, count in rows:
|
||||
months[datetime.strftime(created_date, "%Y-%m")][notification_type][status] = count
|
||||
|
||||
return months
|
||||
|
||||
|
||||
Reference in New Issue
Block a user