django-parler-rest
django-parler-rest copied to clipboard
Fix file+json data post
When posting to a django rest framework model with a file attribute, data is json stringified, so we need to json load it in order to get it.
Codecov Report
Merging #20 into master will increase coverage by
0.08%. The diff coverage is100%.
@@ Coverage Diff @@
## master #20 +/- ##
==========================================
+ Coverage 81.39% 81.48% +0.08%
==========================================
Files 4 4
Lines 129 135 +6
==========================================
+ Hits 105 110 +5
- Misses 24 25 +1
| Impacted Files | Coverage Δ | |
|---|---|---|
| parler_rest/fields.py | 73.4% <100%> (+0.67%) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update 9a3dd7c...af4bc8f. Read the comment docs.
Codecov Report
Merging #20 into master will increase coverage by
0.22%. The diff coverage is100%.
@@ Coverage Diff @@
## master #20 +/- ##
==========================================
+ Coverage 81.39% 81.61% +0.22%
==========================================
Files 4 4
Lines 129 136 +7
==========================================
+ Hits 105 111 +6
- Misses 24 25 +1
| Impacted Files | Coverage Δ | |
|---|---|---|
| parler_rest/fields.py | 73.68% <100%> (+0.95%) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update 9a3dd7c...92e9f05. Read the comment docs.
Hi!
Thanks for this pull request! Aside from a small change, this looks ok to merge. Do you have a bit of test code that shows when this situation occurs? A unit test would even be better!
Ok @vdboor, just added a little test. As said above it simulates the translations field is sent as a json dumps. Useful when uploading file and data.
Cheers.