Opened 18 years ago

Closed 18 years ago

#2155 closed defect (fixed)

[patch]: Unique_for_date fails when the required DateTimeField is left empty in the admin

Reported by: remco@… Owned by: Adrian Holovaty
Component: contrib.admin Version: dev
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

When the publicationDate field in the following model is left empty then the unique_for_date validator function receives an empty date string, in this case the unique_for_date should leave validation up to the publicationDate field (see patch)

class Article(Model):

publicationDate = DateTimeField("Publicatie datum")
linkTitle = SlugField("Link titel", prepopulate_from=("title",), unique_for_month='publicationDate')

Attachments (1)

manipulators.py.diff (696 bytes ) - added by remco@… 18 years ago.

Download all attachments as: .zip

Change History (2)

by remco@…, 18 years ago

Attachment: manipulators.py.diff added

comment:1 by Malcolm Tredinnick, 18 years ago

Resolution: fixed
Status: newclosed

This was fixed in [3277], but somehow I messed up the "auto-close" portion of the commit message. For the record, the commit message was:

Fixed #1980, #2155 -- made date, time and datetime html2python methods a bit more consistent in their return values. All three now return None when the passed in string cannot be converted to the required object (this is assumed elsewhere).

Note: See TracTickets for help on using tickets.
Back to Top