From 16223e49f233ae8dad46911d39c1e3f4f7b3ccd2 Mon Sep 17 00:00:00 2001 From: Tom Hubrecht Date: Sat, 20 Mar 2021 20:21:48 +0100 Subject: [PATCH] On utilise la permission --- elections/views.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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 !")