mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-30 14:31:57 -05:00
Avoid key errors by setting the year_start with 2020 or 2021
Remove db.create_service_with_organisation method Update comment in command
This commit is contained in:
@@ -891,7 +891,7 @@ def populate_annual_billing_with_the_previous_years_allowance(year):
|
||||
def populate_annual_billing_with_defaults(year, missing_services_only):
|
||||
"""
|
||||
Add or update annual billing with free allowance defaults for all active services.
|
||||
DEFAULT_FREE_SMS_FRAGMENT_LIMITS is the new free allowances for the financial year starting 2021.
|
||||
The default free allowance limits are in: app/dao/annual_billing_dao.py:57.
|
||||
|
||||
If missing_services_only is true then only add rows for services that do not have annual billing for that year yet.
|
||||
This is useful to prevent overriding any services that have a free allowance that is not the default.
|
||||
|
||||
@@ -90,6 +90,10 @@ def set_default_free_allowance_for_service(service, year_start=None):
|
||||
}
|
||||
if not year_start:
|
||||
year_start = get_current_financial_year_start_year()
|
||||
if year_start < 2020:
|
||||
year_start = 2020
|
||||
if year_start > 2021:
|
||||
year_start = 2021
|
||||
if service.organisation_type:
|
||||
free_allowance = default_free_sms_fragment_limits[service.organisation_type][year_start]
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user