fix: force choice of From address in Announcement form. Fixes #7679. (#7720)

This commit is contained in:
Ryan Cross 2024-07-20 15:24:14 -07:00 committed by GitHub
parent 60a3976c3d
commit c5ca0ea405
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 3 deletions

View file

@ -42,8 +42,11 @@ def get_from_choices(user):
nomcom_choices = get_nomcom_choices(user)
if nomcom_choices:
addresses = list(addresses) + nomcom_choices
return list(zip(addresses, addresses))
choices = list(zip(addresses, addresses))
if len(choices) > 1:
choices.insert(0, ('', '(Choose an option)'))
return choices
def get_nomcom_choices(user):

View file

@ -48,7 +48,7 @@ class SecrAnnouncementTestCase(TestCase):
r = self.client.get(url)
self.assertEqual(r.status_code, 200)
q = PyQuery(r.content)
self.assertEqual(len(q('#id_frm option')),3)
self.assertEqual(len(q('#id_frm option')),4)
# IAB Chair
self.client.login(username="iab-chair", password="iab-chair+password")