Opened 13 years ago
Closed 13 years ago
#17542 closed Bug (fixed)
SelectDateWidget with required=false throws exception in _has_changed
Reported by: | x.g10f.de | Owned by: | Maciej Wiśniowski |
---|---|---|---|
Component: | Forms | Version: | 1.4-alpha-1 |
Severity: | Normal | Keywords: | SelectDateWidget required false |
Cc: | restless.being@… | Triage Stage: | Ready for checkin |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
When accessing changed_data in a form with SelectDateWidget with required=false and no values for year, month and date selected i get an exception.
The exception is thrown in strptime in
Code highlighting:
def _has_changed(self, initial, data): input_format = get_format('DATE_INPUT_FORMATS')[0] data = datetime_safe.datetime.strptime(data, input_format).date() return super(SelectDateWidget, self)._has_changed(initial, data)
because data is None
Attachments (1)
Change History (7)
comment:1 by , 13 years ago
Needs tests: | set |
---|---|
Owner: | changed from | to
comment:2 by , 13 years ago
Component: | Uncategorized → Forms |
---|---|
Status: | new → assigned |
comment:3 by , 13 years ago
Triage Stage: | Unreviewed → Accepted |
---|---|
Type: | Uncategorized → Bug |
by , 13 years ago
Attachment: | patch_for_17542.diff added |
---|
comment:4 by , 13 years ago
Has patch: | set |
---|
comment:5 by , 13 years ago
Cc: | added |
---|---|
Needs tests: | unset |
Triage Stage: | Accepted → Ready for checkin |
comment:6 by , 13 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
In [17436]:
(The changeset message doesn't reference this ticket)
Note:
See TracTickets
for help on using tickets.
Review done. It works.