Re: [Django] #33907: Uniqueconstraints voided in when using GenericTabularInline

8 views
Skip to first unread message

Django

unread,
Aug 8, 2022, 9:54:27 AM8/8/22
to django-...@googlegroups.com
#33907: Uniqueconstraints voided in when using GenericTabularInline
-------------------------------------+-------------------------------------
Reporter: Mohamed Alnahhas | Owner: nobody
Type: Bug | Status: new
Component: | Version: 4.0
contrib.contenttypes |
Severity: Release blocker | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mohamed Alnahhas):

* cc: Mohamed Alnahhas (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/33907#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Aug 8, 2022, 9:57:16 AM8/8/22
to django-...@googlegroups.com
#33907: Uniqueconstraints voided in when using GenericTabularInline
-------------------------------------+-------------------------------------
Reporter: Mohamed Alnahhas | Owner: nobody
Type: Bug | Status: new
Component: | Version: 4.1

contrib.contenttypes |
Severity: Release blocker | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mohamed Alnahhas):

* version: 4.0 => 4.1


--
Ticket URL: <https://code.djangoproject.com/ticket/33907#comment:3>

Django

unread,
Aug 8, 2022, 1:44:11 PM8/8/22
to django-...@googlegroups.com
#33907: Uniqueconstraints voided in when using GenericTabularInline
-------------------------------------+-------------------------------------
Reporter: Mohamed Alnahhas | Owner: nobody
Type: Bug | Status: new
Component: | Version: 4.1
contrib.contenttypes |
Severity: Release blocker | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Simon Charette):

I didn't test it out but assume this is happening because
`GenericTabularInline`'s form is passing an `exclude` of either
`{'user','content_type', 'object_id'}` the following statement confused me
though

> However creating the same object through GenericTabularInline gives no
errors and the creation is successful when it should not be.

How is this possible, isn't the database crashing due a unique constraint
violation?

Can you also reproduce the same issue by using `unique_together` instead
of `UniqueConstraint(fields=['user','content_type', 'object_id'],
name='unique_object')`. If you can then I'm not convinced this should be
considered a release blocker.

--
Ticket URL: <https://code.djangoproject.com/ticket/33907#comment:4>

Reply all
Reply to author
Forward
0 new messages