Opened 7 years ago

Closed 7 years ago

Last modified 4 years ago

#8209 closed (fixed)

ModelForms (and hence the admin) don't check unique constraints

Reported by: glenjamin Owned by: Alex
Component: Forms Version: master
Severity: Keywords: 1.0-blocker
Cc: tomek+django@… Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description (last modified by jacob)

They don't - in fact in SQLite a raw exception is propagated all the way up.

Attachments (7)

8209_model_forms_unique.diff (3.7 KB) - added by dgouldin 7 years ago.
django-r8769-8209.diff (5.4 KB) - added by Alex 7 years ago.
django-r8769-8209.2.diff (5.7 KB) - added by Alex 7 years ago.
Fixed merge errors with latest trunk
8209_modelform_unique_validation.1.diff (11.5 KB) - added by brosner 7 years ago.
added a patch for review
django-8209.diff (11.6 KB) - added by Alex 7 years ago.
Tiny change from brosner's patch
django-8209.2.diff (12.1 KB) - added by Alex 7 years ago.
New patch
django-8209.3.diff (11.9 KB) - added by Alex 7 years ago.
Removed usage of any

Download all attachments as: .zip

Change History (19)

comment:1 Changed 7 years ago by jacob

  • Component changed from Documentation to Forms
  • Description modified (diff)
  • milestone set to 1.0
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Summary changed from Admin documentation claims that uniqueness is enforced in the interface to ModelForms (and hence the admin) don't check unique constraints
  • Triage Stage changed from Unreviewed to Accepted

Actually, I think ModelForms need to learn how to understand the unique stuff. I'm hijaking this ticket for that :)

comment:2 Changed 7 years ago by oinopion

  • Cc tomek+django@… added

comment:3 Changed 7 years ago by cmarshal

  • Owner changed from nobody to cmarshal
  • Status changed from new to assigned

comment:4 Changed 7 years ago by dgouldin

  • Owner changed from cmarshal to dgouldin
  • Status changed from assigned to new

Changed 7 years ago by dgouldin

comment:5 Changed 7 years ago by gwilson

  • Owner changed from dgouldin to gwilson
  • Status changed from new to assigned

comment:6 Changed 7 years ago by Alex

  • Owner changed from gwilson to Alex
  • Status changed from assigned to new

I've got a patch that I will upload shortly.

Changed 7 years ago by Alex

Changed 7 years ago by Alex

Fixed merge errors with latest trunk

comment:7 Changed 7 years ago by jacob

  • Keywords 1.0-blocker added

Changed 7 years ago by brosner

added a patch for review

comment:8 Changed 7 years ago by brosner

Added an improved patch to deal with formsets and save_as_new stuff.

comment:9 Changed 7 years ago by akaihola

  • Has patch set

Changed 7 years ago by Alex

Tiny change from brosner's patch

comment:10 Changed 7 years ago by Alex

Ignore my patch in favor of brosners.

Changed 7 years ago by Alex

New patch

Changed 7 years ago by Alex

Removed usage of any

comment:11 Changed 7 years ago by jacob

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

(In [8805]) Fixed #8209: ModelForms now validate unique constraints. Alex Gaynor did much of this work, and Brian Rosner helped as well.

comment:12 Changed 4 years ago by jacob

  • milestone 1.0 deleted

Milestone 1.0 deleted

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