Split "get_available_choices" by branding type

We already had different functionality for email branding and will
soon be adding more for email branding pools.

Note that the "get_available_choices" class method was only used for
email branding - we can do it in the constructor for letters.
This commit is contained in:
Ben Thorner
2022-03-22 16:56:50 +00:00
parent f022836f4d
commit 8f55972aae
4 changed files with 62 additions and 34 deletions

View File

@@ -1179,7 +1179,7 @@ def email_branding_request(service_id):
def check_email_branding_allowed_for_service(branding):
allowed_branding_for_service = dict(
ChooseEmailBrandingForm.get_available_choices(current_service, branding_type='email')
ChooseEmailBrandingForm.get_available_choices(current_service)
)
if branding not in allowed_branding_for_service:
abort(404)