diff --git a/elections/views.py b/elections/views.py index 9791689..0488810 100644 --- a/elections/views.py +++ b/elections/views.py @@ -25,7 +25,12 @@ from .forms import ( UploadVotersForm, VoterMailForm, ) -from .mixins import CreatorOnlyEditMixin, CreatorOnlyMixin, OpenElectionOnlyMixin +from .mixins import ( + AdminOnlyMixin, + CreatorOnlyEditMixin, + CreatorOnlyMixin, + OpenElectionOnlyMixin, +) from .models import Election, Option, Question from .staticdefs import MAIL_VOTERS, QUESTION_TYPES, VOTE_RULES from .utils import create_users, send_mail @@ -55,7 +60,7 @@ class BackgroundUpdateView(RedirectView): # ############################################################################# -class ElectionCreateView(SuccessMessageMixin, CreateView): +class ElectionCreateView(AdminOnlyMixin, SuccessMessageMixin, CreateView): model = Election form_class = ElectionForm success_message = _("Élection créée avec succès !")