beda-software / drf-writable-nested

Writable nested model serializer for Django REST Framework
Other
1.07k stars 116 forks source link

Update UniqueFieldsMixin to support DRF 3.11 validator context API #96

Closed mands closed 4 years ago

mands commented 4 years ago

DRF 3.11 changed how context is passed into validators to fix a race-condition, as described in the following links

This PR provides support for this new API in a backwards-compatible way, using set_context if available/on older DRF, and passing the field in with the __call__ if not.

codecov-io commented 4 years ago

Codecov Report

Merging #96 into master will decrease coverage by 0.46%. The diff coverage is 75%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #96      +/-   ##
==========================================
- Coverage   99.05%   98.59%   -0.47%     
==========================================
  Files           3        3              
  Lines         211      213       +2     
==========================================
+ Hits          209      210       +1     
- Misses          2        3       +1
Impacted Files Coverage Δ
drf_writable_nested/mixins.py 98.5% <75%> (-0.49%) :arrow_down:

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 f11b68e...f32ad59. Read the comment docs.

ruscoder commented 4 years ago

@mands Thanks, merged

ruscoder commented 4 years ago

Available on PyPI as v0.5.4