-
Notifications
You must be signed in to change notification settings - Fork 299
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
Fixed crash when patching many-to-many relationships in Django >= 1.9 #330
Conversation
codecov-io
commented
Mar 1, 2017
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
@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.
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! 👍
The app crash with error:
TypeError: add() got an unexpected keyword argument 'bulk'
, when trying to patch many-to-many relationships. In fileexample/tests/test_views.py
was added the test catching this error. It's error is possible only in Django >= 1.9, because was added thebulk
argument inadd()
method for allManager
classes, excludingManyRelatedManager
class. In filerest_framework_json_api/views.py
was added check the class name to fix this error.