Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
allgo
allgo
Commits
65e6eb1d
Commit
65e6eb1d
authored
May 07, 2019
by
sebastien letort
Browse files
In JobAuthMixin, we can safely provided a wrong job id.
parent
af9b6351
Changes
1
Hide whitespace changes
Inline
Side-by-side
django/allgo/main/mixins.py
View file @
65e6eb1d
...
...
@@ -97,7 +97,11 @@ class JobAuthMixin(AllgoValidAccountMixin, UserPassesTestMixin):
if
user
is
None
:
return
False
self
.
raise_exception
=
True
# to return a 403
job
=
Job
.
objects
.
filter
(
pk
=
self
.
kwargs
[
'pk'
]).
first
()
try
:
job
=
Job
.
objects
.
get
(
id
=
self
.
kwargs
[
'pk'
])
except
Job
.
DoesNotExist
:
return
False
return
user
.
is_superuser
or
user
==
getattr
(
job
,
"user"
,
())
def
handle_no_permission
(
self
):
...
...
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