mirror of
https://github.com/ae-utbm/sith.git
synced 2024-11-22 14:13:21 +00:00
Small right fix
This commit is contained in:
parent
2e84ee7d4f
commit
18f856af24
@ -8,6 +8,7 @@ from django.core.exceptions import ValidationError
|
|||||||
|
|
||||||
from core.views import CanViewMixin, CanEditMixin, CanEditPropMixin
|
from core.views import CanViewMixin, CanEditMixin, CanEditPropMixin
|
||||||
from club.models import Club, Membership
|
from club.models import Club, Membership
|
||||||
|
from sith.settings import AE_GROUPS
|
||||||
|
|
||||||
class ClubListView(CanViewMixin, ListView):
|
class ClubListView(CanViewMixin, ListView):
|
||||||
"""
|
"""
|
||||||
@ -41,7 +42,7 @@ class ClubMemberForm(forms.ModelForm):
|
|||||||
"""
|
"""
|
||||||
ret = super(ClubMemberForm, self).clean()
|
ret = super(ClubMemberForm, self).clean()
|
||||||
ms = self.instance.club.get_membership_for(self._user)
|
ms = self.instance.club.get_membership_for(self._user)
|
||||||
if (ms is not None and ms.role >= self.cleaned_data['role']) or self._user.is_superuser:
|
if (ms is not None and ms.role >= self.cleaned_data['role']) or self._user.is_in_group(AE_GROUPS['board']['name']) or self._user.is_superuser:
|
||||||
return ret
|
return ret
|
||||||
raise ValidationError("You do not have the permission to do that")
|
raise ValidationError("You do not have the permission to do that")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user