Commit 3c408551 authored by Sli's avatar Sli

Remove nested exception for stats and added property on AnonymusUser

parent f7722ed5
Pipeline #249 failed with stage
in 7 seconds
......@@ -423,6 +423,14 @@ class AnonymousUser(AuthAnonymousUser):
def is_root(self):
return False
@property
def is_board_member(self):
return False
@property
def is_launderette_manager(self):
return False
def is_in_group(self, group_name):
"""
The anonymous user is only the public group
......
......@@ -728,12 +728,10 @@ class CounterStatView(DetailView, CanEditMixin):
try:
return super(CounterStatView, self).dispatch(request, *args, **kwargs)
except:
try:
if (request.user.is_root
or request.user.is_board_member
or self.object.is_owned_by(request.user)):
return super(CanEditMixin, self).dispatch(request, *args, **kwargs)
except:pass
if (request.user.is_root
or request.user.is_board_member
or self.object.is_owned_by(request.user)):
return super(CanEditMixin, self).dispatch(request, *args, **kwargs)
raise PermissionDenied
......
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