Changes between Initial Version and Version 1 of Ticket #24008
- Timestamp:
- Dec 17, 2014, 8:54:14 AM (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #24008
- Property Component Uncategorized → Core (Other)
- Property Triage Stage Unreviewed → Accepted
- Property Type Uncategorized → Bug
- Property Version 1.6 → 1.7
-
Ticket #24008 – Description
initial v1 4 4 5 5 For example: 6 6 {{{ 7 7 >>> from django.core.exceptions import ValidationError 8 8 >>> ValidationError([ValidationError({'age', 'age cannot be negative'}), ValidationError('Some other error')]) 9 9 }}} 10 10 The problem is caused because when a ValidationError instance is initialised with a dictionary, its error_list attribute is not set (instead error_dict is set) but a ValidationError that is initialised with a list tries to compile a flattened list of all errors using this attribute from each list element. Either ValidationError should be modified to accept a mixture of field and non-field errors (appears to me to be the best solution) or the documentation and error message should be changed to make usage clear. 11 11