Skip to content

Commit

Permalink
fix: force choice of From address in Announcement form. Fixes #7679. (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
rpcross committed Jul 20, 2024
1 parent 60a3976 commit c5ca0ea
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions ietf/secr/announcement/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion ietf/secr/announcement/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def test_main_announce_from(self):
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")
Expand Down

0 comments on commit c5ca0ea

Please sign in to comment.