-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update the release component serializer file #181
Conversation
self._errors = {'release': 'This field is required.'} | ||
return | ||
release = get_object_or_404(Release, release_id=release_id) | ||
if not release.is_active(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we need to keep the check of "Not create release component with an inactive release", we'd better keep validate_release
here.
The reason that test here get passed is because the 'releases' in data is should be 'release'.
Please correct other tests of ReleaseComponent
that with 'releases' in data as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xychu That's a good point. However, the validation still needs to be updated, because the value
argument is always an instance of Release
. Raising ValidationError
would also be a preferable way of failing.
Please note that for bulk update, the key is actually called releases
, so this is quite confusing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, the isinstance
check, which is left from DRFv2.4, is no more needed now.
b2680c9
to
1368353
Compare
This looks good to me. |
The code in component serializer is not reachable, and remove the unreachable code. and then, verify the test case file. JIRA: PDC-1053
The code in component serializer is not reachable,
and remove the unreachable code.
JIRA: PDC-1053