From 630642cf32f7cca90334bcd48ff867549d3f5b50 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20Stra=C3=9Fer?= <andreas.strasser@stusta.de>
Date: Sat, 31 Oct 2020 18:23:34 +0100
Subject: [PATCH] fix max_yes_votes

---
 management/forms.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/management/forms.py b/management/forms.py
index 5495341..351cfbf 100644
--- a/management/forms.py
+++ b/management/forms.py
@@ -81,8 +81,6 @@ class AddSessionForm(forms.ModelForm):
 
 
 class AddElectionForm(forms.ModelForm):
-    max_votes_yes = forms.IntegerField(min_value=1, required=False, label='Maximum number of YES votes (optional)')
-
     def __init__(self, user, session, *args, **kwargs):
         super().__init__(*args, **kwargs)
         self.fields['session'].disabled = True
@@ -91,12 +89,14 @@ class AddElectionForm(forms.ModelForm):
         self.fields['start_date'].widget = forms.TextInput(attrs={'placeholder': 'e.g.: 2020-05-12 13:00:00'})
         self.fields['end_date'].widget = forms.TextInput(attrs={'placeholder': 'e.g.: 2020-05-12 13:00:00'})
         # self.fields['start_date'].initial = timezone.now()
+        self.fields['max_votes_yes'] = forms.IntegerField(min_value=1, required=False,
+                                                          label='Maximum number of YES votes (optional)')
         self.user = user
         self.session = session
 
     class Meta:
         model = Election
-        fields = ('title', 'voters_self_apply', 'start_date', 'end_date', 'session')
+        fields = ('title', 'voters_self_apply', 'start_date', 'end_date', 'max_votes_yes', 'session')
 
         labels = {
             'title': 'Election Name',
-- 
GitLab