Skip to content

Commit 53c0aff

Browse files
authored
Do not accept nominations for elections before they open (#2755)
Update views.py
1 parent 902fb39 commit 53c0aff

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

nominations/views.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,11 @@ def get_form_class(self):
8989
self.request, f"Nominations for {election.name} Election are closed"
9090
)
9191
raise Http404(f"Nominations for {election.name} Election are closed")
92+
if not election.nominations_open:
93+
messages.error(
94+
self.request, f"Nominations for {election.name} Election are not open"
95+
)
96+
raise Http404(f"Nominations for {election.name} Election are not open")
9297

9398
return NominationCreateForm
9499

0 commit comments

Comments
 (0)