Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
AE
Sith
Commits
c40171fe
Commit
c40171fe
authored
Oct 18, 2016
by
Sli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean permission check for alcohol and counter ban
parent
2daaf992
Pipeline
#308
failed with stage
in 6 minutes and 35 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
core/models.py
core/models.py
+10
-2
No files found.
core/models.py
View file @
c40171fe
...
...
@@ -243,11 +243,11 @@ class User(AbstractBaseUser):
@
property
def
is_banned_alcohol
(
self
):
return
self
.
groups
.
filter
(
name
=
settings
.
SITH_GROUPS
[
'banned-alcohol'
][
'name'
])
.
exists
()
return
self
.
is_in_group
(
settings
.
SITH_GROUPS
[
'banned-alcohol'
][
'name'
])
@
property
def
is_banned_counter
(
self
):
return
self
.
groups
.
filter
(
name
=
settings
.
SITH_GROUPS
[
'banned-from-counters'
][
'name'
])
.
exists
()
return
self
.
is_in_group
(
settings
.
SITH_GROUPS
[
'banned-from-counters'
][
'name'
])
def
save
(
self
,
*
args
,
**
kwargs
):
create
=
False
...
...
@@ -439,6 +439,14 @@ class AnonymousUser(AuthAnonymousUser):
def
is_launderette_manager
(
self
):
return
False
@
property
def
is_banned_alcohol
(
self
):
return
False
@
property
def
is_banned_conuter
(
self
):
return
False
def
is_in_group
(
self
,
group_name
):
"""
The anonymous user is only the public group
...
...
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