Re: [Django] #35488: BaseModelFormSet.validate_unique() raises unhashable type error for unique fields with unhashable types

27 views
Skip to first unread message

Django

unread,
May 29, 2024, 7:17:47 PM5/29/24
to django-...@googlegroups.com
#35488: BaseModelFormSet.validate_unique() raises unhashable type error for unique
fields with unhashable types
-------------------------------------+-------------------------------------
Reporter: Hanne Moa | Owner: nobody
Type: Bug | Status: new
Component: Forms | Version: 5.0
Severity: Normal | Resolution:
Keywords: JSONField, unique, | Triage Stage: Accepted
formset, json, hashable |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Simon Charette):

* easy: 0 => 1

Comment:

Marking as ''easy picking'' as all that is required here is likely to
submit a PR with the change above to use `make_hashable` and add a test
similar to the one added in 06a11ef6ecf324db0a1530b8cca727883698f442 but
using a `form.JSONField` instead.

It might be a good one to pick up if you've never contributed to Django
Hanne!
--
Ticket URL: <https://code.djangoproject.com/ticket/35488#comment:5>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
May 30, 2024, 10:25:00 AM5/30/24
to django-...@googlegroups.com
#35488: BaseModelFormSet.validate_unique() raises unhashable type error for unique
fields with unhashable types
-------------------------------------+-------------------------------------
Reporter: Hanne Moa | Owner:
| DraKen0009
Type: Bug | Status: assigned
Component: Forms | Version: 5.0
Severity: Normal | Resolution:
Keywords: JSONField, unique, | Triage Stage: Accepted
formset, json, hashable |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by DraKen0009):

* owner: nobody => DraKen0009
* status: new => assigned

--
Ticket URL: <https://code.djangoproject.com/ticket/35488#comment:6>

Django

unread,
Jun 8, 2024, 5:09:53 AM6/8/24
to django-...@googlegroups.com
#35488: BaseModelFormSet.validate_unique() raises unhashable type error for unique
fields with unhashable types
-------------------------------------+-------------------------------------
Reporter: Hanne Moa | Owner: (none)
Type: Bug | Status: new
Component: Forms | Version: 5.0
Severity: Normal | Resolution:
Keywords: JSONField, unique, | Triage Stage: Accepted
formset, json, hashable |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by DraKen0009):

* owner: DraKen0009 => (none)
* status: assigned => new

--
Ticket URL: <https://code.djangoproject.com/ticket/35488#comment:7>

Django

unread,
Jun 8, 2024, 7:01:08 AM6/8/24
to django-...@googlegroups.com
#35488: BaseModelFormSet.validate_unique() raises unhashable type error for unique
fields with unhashable types
-------------------------------------+-------------------------------------
Reporter: Hanne Moa | Owner: Madalin
| Popa
Type: Bug | Status: assigned
Component: Forms | Version: 5.0
Severity: Normal | Resolution:
Keywords: JSONField, unique, | Triage Stage: Accepted
formset, json, hashable |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Madalin Popa):

* owner: (none) => Madalin Popa
* status: new => assigned

--
Ticket URL: <https://code.djangoproject.com/ticket/35488#comment:8>

Django

unread,
Jun 8, 2024, 9:34:50 AM6/8/24
to django-...@googlegroups.com
#35488: BaseModelFormSet.validate_unique() raises unhashable type error for unique
fields with unhashable types
-------------------------------------+-------------------------------------
Reporter: Hanne Moa | Owner: Madalin
| Popa
Type: Bug | Status: assigned
Component: Forms | Version: 5.0
Severity: Normal | Resolution:
Keywords: JSONField, unique, | Triage Stage: Accepted
formset, json, hashable |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Madalin Popa):

* has_patch: 0 => 1

Comment:

Created PR: https://github.com/django/django/pull/18245
--
Ticket URL: <https://code.djangoproject.com/ticket/35488#comment:9>

Django

unread,
Jun 13, 2024, 7:48:51 AM6/13/24
to django-...@googlegroups.com
#35488: BaseModelFormSet.validate_unique() raises unhashable type error for unique
fields with unhashable types
-------------------------------------+-------------------------------------
Reporter: Hanne Moa | Owner: Madalin
| Popa
Type: Bug | Status: assigned
Component: Forms | Version: 5.0
Severity: Normal | Resolution:
Keywords: JSONField, unique, | Triage Stage: Ready for
formset, json, hashable | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce):

* stage: Accepted => Ready for checkin

--
Ticket URL: <https://code.djangoproject.com/ticket/35488#comment:10>

Django

unread,
Jun 13, 2024, 10:22:04 AM6/13/24
to django-...@googlegroups.com
#35488: BaseModelFormSet.validate_unique() raises unhashable type error for unique
fields with unhashable types
-------------------------------------+-------------------------------------
Reporter: Hanne Moa | Owner: Madalin
| Popa
Type: Bug | Status: closed
Component: Forms | Version: 5.0
Severity: Normal | Resolution: fixed
Keywords: JSONField, unique, | Triage Stage: Ready for
formset, json, hashable | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce <42296566+sarahboyce@…>):

* resolution: => fixed
* status: assigned => closed

Comment:

In [changeset:"d28626ecf8bd340084ed70ff2d88e8dbab001e2c" d28626e]:
{{{#!CommitTicketReference repository=""
revision="d28626ecf8bd340084ed70ff2d88e8dbab001e2c"
Fixed #35488 -- Fixed BaseModelFormSet.validate_unique() crash due to
unhashable type.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/35488#comment:11>

Django

unread,
Jun 14, 2024, 8:22:33 AM6/14/24
to django-...@googlegroups.com
#35488: BaseModelFormSet.validate_unique() raises unhashable type error for unique
fields with unhashable types
-------------------------------------+-------------------------------------
Reporter: Hanne Moa | Owner: Madalin
| Popa
Type: Bug | Status: closed
Component: Forms | Version: 5.0
Severity: Normal | Resolution: fixed
Keywords: JSONField, unique, | Triage Stage: Ready for
formset, json, hashable | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Sarah Boyce <42296566+sarahboyce@…>):

In [changeset:"dbd1a8bd41f827e5af2ca167bdcccfeeeecbd939" dbd1a8bd]:
{{{#!CommitTicketReference repository=""
revision="dbd1a8bd41f827e5af2ca167bdcccfeeeecbd939"
[5.1.x] Fixed #35488 -- Fixed BaseModelFormSet.validate_unique() crash due
to unhashable type.

Backport of d28626ecf8bd340084ed70ff2d88e8dbab001e2c from main.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/35488#comment:12>
Reply all
Reply to author
Forward
0 new messages