Opened 6 years ago

Closed 6 years ago

#11673 closed (duplicate)

submitting an empty forms.DateTimeField fails even with models null and blank and required=False for the form field

Reported by: Skylar Saveland <skylar.saveland@…> Owned by: nobody
Component: Uncategorized Version: 1.1
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


If you have a model like:

class Event(models.Model):
    end = models.DateTimeField(blank=True, null=True) 

and a modelform like:

from django import forms from events.models import Event

class EventForm(forms.ModelForm):

    end = forms.DateTimeField(('%m/%d/%Y %H:%M',),


            date_format='%m/%d/%Y', time_format='%H:%M',

        ), required=False


    class Meta:

        model = Event

submitting an empty field will cause a validation error.

Change History (1)

comment:1 Changed 6 years ago by Alex

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to duplicate
  • Status changed from new to closed

Closing as a dupe of #11672 since I reformatted that one. Please don't open a second ticket, someone with edit privledges can fix it up.

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