Opened 8 years ago

Closed 8 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@… 8 years ago.

Download all attachments as: .zip

Change History (2)

Changed 8 years ago by remco@…

comment:1 Changed 8 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).

Add Comment

Modify Ticket

Change Properties
<Author field>
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.