django-parler-rest icon indicating copy to clipboard operation
django-parler-rest copied to clipboard

Fix file+json data post

Open GuillaumeCisco opened this issue 8 years ago • 4 comments

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.

GuillaumeCisco avatar Jun 23 '17 17:06 GuillaumeCisco

Codecov Report

Merging #20 into master will increase coverage by 0.08%. The diff coverage is 100%.

Impacted file tree graph

@@            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 data Powered by Codecov. Last update 9a3dd7c...af4bc8f. Read the comment docs.

codecov[bot] avatar Jun 26 '17 08:06 codecov[bot]

Codecov Report

Merging #20 into master will increase coverage by 0.22%. The diff coverage is 100%.

Impacted file tree graph

@@            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 data Powered by Codecov. Last update 9a3dd7c...92e9f05. Read the comment docs.

codecov[bot] avatar Jun 26 '17 08:06 codecov[bot]

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!

vdboor avatar Jul 04 '17 10:07 vdboor

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.

GuillaumeCisco avatar Jul 18 '17 10:07 GuillaumeCisco