tldr;
    1. Serializer errors won't be caught by serializer validation.
    2. DRF does not use full_clean(), so if data passes serializer
validation, it gets into the db.
    3. We can use full_clean for process level validation.

During a lengthy discussion on IRC, I incorrectly asserted that full_clean
did not work with DRF.

My thinking was partly based on the incorrect assumption that the data was
valid. This seemed reasonable given that I created the data from the REST
API, so the data was validated by the serializers. After a closer look, I
fixed an issue with the serializer and was able to use full_clean() as
expected.

The serializer formatted the REST data and then validated the data against
its own expectations. Of course it thought it was right!
_______________________________________________
Pulp-dev mailing list
Pulp-dev@redhat.com
https://www.redhat.com/mailman/listinfo/pulp-dev

Reply via email to