mirror of
https://github.com/django/django.git
synced 2025-10-29 08:36:09 +00:00
Fixed ModelState breaking when unique_together has unhashable elements.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
from django.db import models
|
||||
from django.db.models.loading import BaseAppCache
|
||||
from django.db.models.options import DEFAULT_NAMES
|
||||
from django.db.models.options import DEFAULT_NAMES, normalize_unique_together
|
||||
from django.utils import six
|
||||
from django.utils.module_loading import import_by_path
|
||||
|
||||
@@ -127,7 +127,8 @@ class ModelState(object):
|
||||
continue
|
||||
elif name in model._meta.original_attrs:
|
||||
if name == "unique_together":
|
||||
options[name] = set(model._meta.original_attrs["unique_together"])
|
||||
ut = model._meta.original_attrs["unique_together"]
|
||||
options[name] = set(normalize_unique_together(ut))
|
||||
else:
|
||||
options[name] = model._meta.original_attrs[name]
|
||||
# Make our record
|
||||
|
||||
Reference in New Issue
Block a user