Closed mrmachine closed 4 years ago
Repository health increased by 2% when pulling 178046f on ixc:cannot-save-polymorphic into f5f7207 on paulocheque:master.
@paulocheque any feedback on this issue?
@mrmachine The like the try/except
code. I would like to merge this code without the extra code. Check my comments in the #59 issue
Closing in favor of https://github.com/paulocheque/django-dynamic-fixture/pull/112
If an exception is raised in the
save()
method of a polymorphic model, DDF tries to print all the field values for the model which will in turn raise aDoesNotExist
exception on the*_ptr
field, that masks the real exception.This commit catches and displays the
repr()
of exceptions raised in when displaying field values in theprint_field_values_of_a_model()
method, which allows the real exception to exposed viaBadDataError
.It might be more appropriate to just not display field values for
*_ptr
fields, though, as they are not set directly by the user.