CharField's widget_attrs should return an empty dict rather than None
|Reported by:||gg||Owned by:||gg|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
When self.max_length is None or widget is not a TextInput or PasswordInput instance, no return value is specified.
Returning None can break things when a dict is expected. Theoretically, it should probably call the superclass' widget_attrs and update the dict with its own values (if the conditions are met). In practice, I'm not sure the super call really matters.
Change History (3)
comment:1 Changed 6 years ago by russellm
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
- Triage Stage changed from Unreviewed to Accepted