Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
grady
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jan Maximilian Michal
grady
Merge requests
!63
Fixes a permission for the reviewer
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Fixes a permission for the reviewer
reviewer-cannot-patch-or-create
into
master
Overview
0
Commits
1
Pipelines
2
Changes
1
Merged
Jan Maximilian Michal
requested to merge
reviewer-cannot-patch-or-create
into
master
7 years ago
Overview
0
Commits
1
Pipelines
2
Changes
1
Expand
0
0
Merge request reports
Viewing commit
7b014e65
Show latest version
1 file
+
4
−
2
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
7b014e65
Fixes a permission for the reviewer
· 7b014e65
Jan Maximilian Michal
authored
7 years ago
core/views/feedback.py
+
4
−
2
Options
@@ -31,14 +31,14 @@ class FeedbackApiView(
def
_get_implicit_assignment_for_user
(
self
,
submission
):
"""
Check for tutor if it exists. Not relevant for reviewer
"""
if
self
.
request
.
user
.
role
==
models
.
UserAccount
.
REVIEWER
:
return
try
:
return
models
.
TutorSubmissionAssignment
.
objects
.
get
(
subscription__owner
=
self
.
request
.
user
,
submission
=
submission
)
except
models
.
TutorSubmissionAssignment
.
DoesNotExist
:
if
self
.
request
.
user
.
role
==
models
.
UserAccount
.
REVIEWER
:
return
None
raise
PermissionDenied
(
detail
=
'
This user has no permission to create this feedback
'
)
@@ -59,6 +59,8 @@ class FeedbackApiView(
return
assignment
==
youngest
def
_tutor_attempts_to_patch_first_feedback_final
(
self
,
serializer
):
if
self
.
request
.
user
.
role
==
models
.
UserAccount
.
REVIEWER
:
return
False
is_final_set
=
serializer
.
validated_data
.
get
(
'
is_final
'
,
False
)
submission
=
self
.
get_object
().
of_submission
assignment
=
self
.
_get_implicit_assignment_for_user
(
submission
)
Loading