mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-01 04:09:46 -04:00
Fix email branding request page with only textbox
If there aren’t a range of options (normally presented as radio buttons) to show the user on the email branding request page then we just show the textbox. But we were still doing form validation on the radio buttons, even though the user couldn’t see them to click them. This stopped the user from being able to submit the form. This commit fixes the problem by, in this specific case, pre-ticking the ‘Something else’ radio button.
This commit is contained in:
@@ -1368,8 +1368,8 @@ class BrandingOptionsEmail(StripWhitespaceForm):
|
||||
def __init__(self, service, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
self.options.choices = tuple(self.get_available_choices(service))
|
||||
if not self.something_else_is_only_option:
|
||||
self.options.validators.append(DataRequired())
|
||||
if self.something_else_is_only_option:
|
||||
self.options.data = self.FALLBACK_OPTION_VALUE
|
||||
|
||||
@staticmethod
|
||||
def get_available_choices(service):
|
||||
|
||||
Reference in New Issue
Block a user