field_mapping.py
10.5 KB
-
Don't filter out the DecimalValidator if it is not supported · 87605e1e
Previously, all validators set on a DecimalField in Django would be stripped when converted to a Django REST framework field. This was because any validator that was an instance of `DecimalValidator` would be removed, and when `DecimalValidator` wasn't supported (so it was `None`), all validators would be removed. This fixes the issue by only removing the `DecimalValidator` instances if the `DecimalValidator` is supported.
Kevin Brown committed