Closed
Description
When a form using a composite type widget is used with a generic form view (e.g. django.views.generic.UpdateView
, or from the Django admin site), and the form has validation errors, the widgets that make up the composite type will be rendered without their values.
The issue seems to be that the CompositeTypeWidget.render
method uses getattr(value, subname, None)
to retrieve the values for the individual fields. This fails because when we're rendering the form with validation errors value
is a dict
, and not an instance of a subclass of CompositeType
(as it is when we're rendering the form without errors).