Opened 9 years ago

Closed 9 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
Component: contrib.admin Version: master
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


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) (696 bytes) - added by remco@… 9 years ago.

Download all attachments as: .zip

Change History (2)

Changed 9 years ago by remco@…

comment:1 Changed 9 years ago by mtredinnick

  • Resolution set to fixed
  • Status changed from new to closed

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