mirror of
https://github.com/django/django.git
synced 2025-10-25 06:36:07 +00:00
Fixed #21469 -- Allow set objects in Meta.unique_together.
Thanks to Tim for the review.
This commit is contained in:
@@ -32,6 +32,7 @@ def normalize_unique_together(unique_together):
|
||||
tuple of two strings. Normalize it to a tuple of tuples, so that
|
||||
calling code can uniformly expect that.
|
||||
"""
|
||||
unique_together = tuple(unique_together)
|
||||
if unique_together and not isinstance(unique_together[0], (tuple, list)):
|
||||
unique_together = (unique_together,)
|
||||
return unique_together
|
||||
|
||||
Reference in New Issue
Block a user