Skip to content

Commit 236ddec

Browse files
fix: Fix duplicate constraint generation (#789)
Refs #785
1 parent c4fc8d5 commit 236ddec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modeltranslation/translator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,8 +325,8 @@ def add_unique_together():
325325
for constraint in model._meta.unique_together:
326326
for field_name in opts.fields:
327327
if field_name in constraint:
328-
new_constraint = list(constraint)
329328
for translated_name in get_translation_fields(field_name):
329+
new_constraint = list(constraint)
330330
new_constraint[constraint.index(field_name)] = translated_name
331331
yield new_constraint
332332

0 commit comments

Comments
 (0)