Commit 5449a4fc authored by Sli's avatar Sli

Little permission fix

parent e17fd22a
......@@ -362,7 +362,9 @@ th {
{%- endif %}
<a href="{{url('election:create_list', election_id=object.id)}}">{% trans %}Add a new list{% endtrans %}</a>
{%- if user.can_edit(election) %}
{% if election.is_vote_editable %}
<a href="{{url('election:create_role', election_id=object.id)}}">{% trans %}Add a new role{% endtrans %}</a>
{% endif %}
<a href="{{url('election:update', election_id=object.id)}}">{% trans %}Edit{% endtrans %}</a>
{%- endif %}
</section>
......
......@@ -289,7 +289,7 @@ class RoleCreateView(CanCreateMixin, CreateView):
def dispatch(self, request, *arg, **kwargs):
self.election = get_object_or_404(Election, pk=kwargs['election_id'])
if self.election.is_vote_editable:
if not self.election.is_vote_editable:
raise PermissionDenied
return super(RoleCreateView, self).dispatch(request, *arg, **kwargs)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment