Opened 7 years ago

Closed 7 years ago

#7627 closed (invalid)

DateField raises errors from admin edit form

Reported by: slinkp Owned by: nobody
Component: Uncategorized Version: newforms-admin
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

In any model with a DateField, I can create them fine in the newforms admin UI, but after that I can't edit them
again because the value of the field is set incorrectly in the edit form.

To reproduce:

  1. Create a model with a required DateField (do not use auto_now).
  2. Give your model a basic admin UI.
  3. Fire up the dev server and use the admin UI to add an instance of your model. Use the "Today" button to set the date. It saves just fine.
  4. Click on your instance in the Changelist display to edit it.
  5. Click "Save". You get a validation error even though you have not changed anything.
  6. Notice that "00:00:00" was appended to your date. If you manually delete the "00:00:00" and click "Save and continue editing", it works.
  7. Click "Save" again and you get the error again. Repeat ad nauseum.

Tested as of newforms-admin r7815, using MySQL.

Change History (1)

comment:1 Changed 7 years ago by slinkp

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

Disregard this report. I had changed a DateTimeField into a DateField, and I thought I had fully reset my database, but I hadn't.

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