Hi folks!
Browsable DRF forms (and Django forms in general) usually keep the data after validation errors (they send the data back to the browser for correction). In DRF 3.x this only happens if exceptions.ValidationError is raised inside Serializer.is_valid(raise_exception=True) call.
In my case, some of the validation exceptions are raised in Serializer.create(), because I want DB row locking and transaction isolation. Unfortunately, this discards form data from the response, because serializer is not added to ReturnDict or ReturnList and BrowsableAPIRenderer.get_rendered_html_form() can't reuse it.
What is the best way to keep form data between validation errors and raise exceptions during Serializer.create()? In pre 2.0 DRF days it was possible to raise validation exceptions inside view code without any problems.