Fix rights in election

This commit is contained in:
Antoine Bartuccio 2016-12-22 00:54:22 +01:00
parent 177e39bd6e
commit 938e2ce0a9

View File

@ -134,9 +134,6 @@ class CandidatureCreateView(CanCreateMixin, FormView):
data = form.clean()
res = super(FormView, self).form_valid(form)
data['election'] = Election.objects.get(id=self.election_id)
if data['user'].is_root:
self.create_candidature(data)
return res
for grp in data['election'].candidature_groups.all():
if data['user'].is_in_group(grp):
self.create_candidature(data)