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
Commits
f8430ac1
Commit
f8430ac1
authored
5 years ago
by
Jakob Dieterle
Committed by
Dominik Seeger
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Resolve "re-submit fails with label only"
parent
9aab5df0
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!220
Resolve "re-submit fails with label only"
Pipeline
#119418
passed
5 years ago
Stage: build
Stage: test
Changes
1
Pipelines
5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/serializers/feedback.py
+7
-2
7 additions, 2 deletions
core/serializers/feedback.py
with
7 additions
and
2 deletions
core/serializers/feedback.py
+
7
−
2
View file @
f8430ac1
...
@@ -160,11 +160,16 @@ class FeedbackSerializer(DynamicFieldsModelSerializer):
...
@@ -160,11 +160,16 @@ class FeedbackSerializer(DynamicFieldsModelSerializer):
self
.
instance
is
not
None
and
self
.
instance
is
not
None
and
self
.
instance
.
feedback_lines
.
count
()
>
0
)
self
.
instance
.
feedback_lines
.
count
()
>
0
)
has_label_attached
=
'
labels
'
in
data
and
len
(
data
[
'
labels
'
])
>
0
has_label_attached
=
(
'
labels
'
in
data
and
len
(
data
[
'
labels
'
])
>
0
or
self
.
instance
is
not
None
and
self
.
instance
.
labels
.
count
()
>
0
)
labels_get_deleted
=
'
labels
'
in
data
and
len
(
data
[
'
labels
'
])
==
0
# a non-full scored feedback is considered valid if there is
# a non-full scored feedback is considered valid if there is
# at least one comment line or a label attached to the feedback
# at least one comment line or a label attached to the feedback
if
not
(
has_full_score
or
has_feedback_lines
or
has_label_attached
):
if
not
(
has_full_score
or
has_feedback_lines
or
(
has_label_attached
and
not
labels_get_deleted
)):
raise
serializers
.
ValidationError
(
raise
serializers
.
ValidationError
(
'
Sorry, you have to explain why this does not get full score
'
)
'
Sorry, you have to explain why this does not get full score
'
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment