mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-03-24 04:02:54 -04:00
Use "get_email_choices" directly in branding view
This commit is contained in:
@@ -2200,13 +2200,10 @@ class ChooseEmailBrandingForm(ChooseBrandingForm):
|
||||
|
||||
def __init__(self, service):
|
||||
super().__init__()
|
||||
self.options.choices = tuple(self.get_available_choices(service))
|
||||
|
||||
@classmethod
|
||||
def get_available_choices(cls, service):
|
||||
return (
|
||||
self.options.choices = tuple(
|
||||
list(branding.get_email_choices(service)) +
|
||||
[cls.FALLBACK_OPTION]
|
||||
[self.FALLBACK_OPTION]
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -70,6 +70,7 @@ from app.main.forms import (
|
||||
)
|
||||
from app.utils import DELIVERED_STATUSES, FAILURE_STATUSES, SENDING_STATUSES
|
||||
from app.utils.branding import NHS_EMAIL_BRANDING_ID
|
||||
from app.utils.branding import get_email_choices as get_email_branding_choices
|
||||
from app.utils.user import (
|
||||
user_has_permissions,
|
||||
user_is_gov_user,
|
||||
@@ -1178,8 +1179,9 @@ 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)
|
||||
get_email_branding_choices(current_service)
|
||||
)
|
||||
|
||||
if branding not in allowed_branding_for_service:
|
||||
abort(404)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user