mirror of
https://github.com/ae-utbm/sith.git
synced 2024-11-25 18:44:23 +00:00
Hide start_date for non root user from clubs
This commit is contained in:
parent
41c9f6381a
commit
fb09719317
@ -133,6 +133,8 @@ class ClubMembersView(ClubTabsMixin, CanViewMixin, UpdateView):
|
|||||||
form.instance = Membership.objects.filter(club=self.object).filter(user=form.data.get('user')).filter(end_date=None).first()
|
form.instance = Membership.objects.filter(club=self.object).filter(user=form.data.get('user')).filter(end_date=None).first()
|
||||||
if form.instance is None: # Instanciate a new membership
|
if form.instance is None: # Instanciate a new membership
|
||||||
form.instance = Membership(club=self.object, user=self.request.user)
|
form.instance = Membership(club=self.object, user=self.request.user)
|
||||||
|
if not self.request.user.is_root:
|
||||||
|
form.fields.pop('start_date', None)
|
||||||
# form.initial = {'user': self.request.user}
|
# form.initial = {'user': self.request.user}
|
||||||
# form._user = self.request.user
|
# form._user = self.request.user
|
||||||
return form
|
return form
|
||||||
|
Loading…
Reference in New Issue
Block a user