mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-05-05 08:31:00 -04:00
Set form choices as a list, not an iterator
Iterators can be exhausted, causing options to unexpectedly disappear from the radio buttons.
This commit is contained in:
@@ -1200,12 +1200,12 @@ class TemplateAndFoldersSelectionForm(Form):
|
||||
if item['id'] != str(current_folder_id)
|
||||
]
|
||||
|
||||
self.add_template_by_template_type.choices = filter(None, [
|
||||
self.add_template_by_template_type.choices = list(filter(None, [
|
||||
('email', 'Email template'),
|
||||
('sms', 'Text message template'),
|
||||
('letter', 'Letter template') if allow_adding_letter_template else None,
|
||||
('copy-existing', 'Copy of an existing template') if allow_adding_copy_of_template else None,
|
||||
])
|
||||
]))
|
||||
|
||||
def validate(self):
|
||||
self.op = request.form.get('operation')
|
||||
|
||||
Reference in New Issue
Block a user