mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-10 03:49:24 +00:00
Fix club rights
This commit is contained in:
@ -96,6 +96,10 @@ class User(AbstractBaseUser, PermissionsMixin):
|
||||
def to_dict(self):
|
||||
return self.__dict__
|
||||
|
||||
def is_in_group(self, group_name):
|
||||
"""If the user is in the group passed in argument (as string)"""
|
||||
return self.groups.filter(name=group_name).exists()
|
||||
|
||||
def get_profile(self):
|
||||
return {
|
||||
"last_name": self.last_name,
|
||||
|
@ -72,9 +72,6 @@ class CanViewMixin(View):
|
||||
"""
|
||||
def dispatch(self, request, *arg, **kwargs):
|
||||
res = super(CanViewMixin, self).dispatch(request, *arg, **kwargs)
|
||||
import traceback
|
||||
traceback.print_stack(limit=10)
|
||||
print(self.__dict__)
|
||||
if hasattr(self, 'object'):
|
||||
obj = self.object
|
||||
elif hasattr(self, 'object_list'):
|
||||
|
Reference in New Issue
Block a user