Skip to content

Commit

Permalink
Fix bug 1405256: Fix migration (#895)
Browse files Browse the repository at this point in the history
Delete TranslationMemoryEntry instances first, because the tms QuerySet
gets empty after the Translation instances are deleted.
  • Loading branch information
mathjazz committed Mar 12, 2018
1 parent 904fdc8 commit 4269ce6
Showing 1 changed file with 3 additions and 1 deletion.
Expand Up @@ -43,8 +43,10 @@ def delete_ftl_duplicates(apps, schema):
translations = Translation.objects.filter(pk__in=duplicates)
tms = TranslationMemoryEntry.objects.filter(translation__pk__in=duplicates)

translations.delete()
# Delete TranslationMemoryEntry instances first, because the tms QuerySet
# gets empty after the Translation instances are deleted.
tms.delete()
translations.delete()


class Migration(migrations.Migration):
Expand Down

0 comments on commit 4269ce6

Please sign in to comment.