Skip to content

Commit

Permalink
fix: more robust migration
Browse files Browse the repository at this point in the history
Co-authored-by: Jillian <[email protected]>
  • Loading branch information
bradenmacdonald and pomegranited committed Oct 10, 2023
1 parent ece987a commit 95a4e60
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def mark_language_taxonomy_as_all_orgs(apps, _schema_editor):
Associates the system defined taxonomy Language (id=-1) to all orgs.
"""
TaxonomyOrg = apps.get_model("content_tagging", "TaxonomyOrg")
TaxonomyOrg.objects.create(taxonomy_id=-1, org=None)
TaxonomyOrg.objects.update_or_create(taxonomy_id=-1, defaults={"org": None})


def revert_mark_language_taxonomy_as_all_orgs(apps, _schema_editor):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def setUp(self):
"visible_to_authors": True,
"_taxonomy_class": "openedx_tagging.core.tagging.models.system_defined.LanguageTaxonomy",
})
TaxonomyOrg.objects.create(taxonomy_id=-1, org=None)
TaxonomyOrg.objects.get_or_create(taxonomy_id=-1, defaults={"org": None})


@skip_unless_cms # Auto-tagging is only available in the CMS
Expand Down

0 comments on commit 95a4e60

Please sign in to comment.