Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
AE
Sith
Commits
3c408551
Commit
3c408551
authored
Sep 27, 2016
by
Sli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove nested exception for stats and added property on AnonymusUser
parent
f7722ed5
Pipeline
#249
failed with stage
in 7 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
6 deletions
+12
-6
core/models.py
core/models.py
+8
-0
counter/views.py
counter/views.py
+4
-6
No files found.
core/models.py
View file @
3c408551
...
@@ -423,6 +423,14 @@ class AnonymousUser(AuthAnonymousUser):
...
@@ -423,6 +423,14 @@ class AnonymousUser(AuthAnonymousUser):
def
is_root
(
self
):
def
is_root
(
self
):
return
False
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
):
def
is_in_group
(
self
,
group_name
):
"""
"""
The anonymous user is only the public group
The anonymous user is only the public group
...
...
counter/views.py
View file @
3c408551
...
@@ -728,12 +728,10 @@ class CounterStatView(DetailView, CanEditMixin):
...
@@ -728,12 +728,10 @@ class CounterStatView(DetailView, CanEditMixin):
try
:
try
:
return
super
(
CounterStatView
,
self
).
dispatch
(
request
,
*
args
,
**
kwargs
)
return
super
(
CounterStatView
,
self
).
dispatch
(
request
,
*
args
,
**
kwargs
)
except
:
except
:
try
:
if
(
request
.
user
.
is_root
if
(
request
.
user
.
is_root
or
request
.
user
.
is_board_member
or
request
.
user
.
is_board_member
or
self
.
object
.
is_owned_by
(
request
.
user
)):
or
self
.
object
.
is_owned_by
(
request
.
user
)):
return
super
(
CanEditMixin
,
self
).
dispatch
(
request
,
*
args
,
**
kwargs
)
return
super
(
CanEditMixin
,
self
).
dispatch
(
request
,
*
args
,
**
kwargs
)
except
:
pass
raise
PermissionDenied
raise
PermissionDenied
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment