Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fixed crash when patching many-to-many relationships in Django >= 1.9 #330

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

Merged
mblayman merged 1 commit into django-json-api:develop from DmitriyZverev:bugfix/relationship-view-patch
Mar 7, 2017
Merged

Fixed crash when patching many-to-many relationships in Django >= 1.9 #330

mblayman merged 1 commit into django-json-api:develop from DmitriyZverev:bugfix/relationship-view-patch
Mar 7, 2017

Conversation

Copy link
Contributor

@DmitriyZverev DmitriyZverev commented Mar 1, 2017

The app crash with error: TypeError: add() got an unexpected keyword argument 'bulk', when trying to patch many-to-many relationships. In file example/tests/test_views.py was added the test catching this error. It's error is possible only in Django >= 1.9, because was added the bulk argument in add() method for all Manager classes, excluding ManyRelatedManager class. In file rest_framework_json_api/views.py was added check the class name to fix this error.

Copy link

Codecov Report

Merging #330 into develop will increase coverage by 0.03%.
The diff coverage is 100%.

@@ Coverage Diff @@
## develop #330 +/- ##
===========================================
+ Coverage 91.64% 91.68% +0.03% 
===========================================
 Files 50 50 
 Lines 2359 2368 +9 
===========================================
+ Hits 2162 2171 +9 
 Misses 197 197
Impacted Files Coverage Δ
example/tests/test_views.py 100% <100%> (ø)
rest_framework_json_api/views.py 82.19% <100%> (+0.12%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fbe49a1...b38f439. Read the comment docs.

Copy link
Collaborator

mblayman commented Mar 3, 2017

@DmitriyZverev, thanks for the contribution! I'll check out the details of the branch when I have time to investigate the issue and your proposed solution.

Copy link
Collaborator

mblayman commented Mar 7, 2017

This looks pretty good to me. Doing an if check on a class name feels non-optimal to me, but Django does not seem to provide many reasonable alternatives.

Thanks! 👍

@mblayman mblayman merged commit d8c3dc4 into django-json-api:develop Mar 7, 2017
@DmitriyZverev DmitriyZverev deleted the bugfix/relationship-view-patch branch March 8, 2017 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /