On utilise la permission
This commit is contained in:
parent
71e22a139f
commit
16223e49f2
1 changed files with 7 additions and 2 deletions
|
@ -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 !")
|
||||
|
|
Loading…
Reference in a new issue