Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/openedx_core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
"""

# The version for the entire repository
__version__ = "0.34.1"
__version__ = "0.34.2"
2 changes: 1 addition & 1 deletion src/openedx_tagging/migrations/0012_language_taxonomy.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def create_language_taxonomy(apps, schema_editor):
"allow_multiple": False,
"allow_free_text": False,
"visible_to_authors": True,
"_taxonomy_class": "openedx_tagging.models.system_defined.LanguageTaxonomy",
"_taxonomy_class": "openedx_tagging.core.tagging.models.system_defined.LanguageTaxonomy",
})

# But delete any unused tags created by the old fixture:
Expand Down
33 changes: 33 additions & 0 deletions src/openedx_tagging/migrations/0019_language_taxonomy_class.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
"""
Data migration to update the _taxonomy_class on the Languages system taxonomy
to reflect the new module path after the package rename.

Old: openedx_tagging.core.tagging.models.system_defined.LanguageTaxonomy
New: openedx_tagging.models.system_defined.LanguageTaxonomy
"""

from django.db import migrations

OLD_CLASS = "openedx_tagging.core.tagging.models.system_defined.LanguageTaxonomy"
NEW_CLASS = "openedx_tagging.models.system_defined.LanguageTaxonomy"


def update_language_taxonomy_class(apps, schema_editor):
Taxonomy = apps.get_model("oel_tagging", "Taxonomy")
Taxonomy.objects.filter(_taxonomy_class=OLD_CLASS).update(_taxonomy_class=NEW_CLASS)


def revert_language_taxonomy_class(apps, schema_editor):
Taxonomy = apps.get_model("oel_tagging", "Taxonomy")
Taxonomy.objects.filter(_taxonomy_class=NEW_CLASS).update(_taxonomy_class=OLD_CLASS)


class Migration(migrations.Migration):

dependencies = [
("oel_tagging", "0018_objecttag_is_copied"),
]

operations = [
migrations.RunPython(update_language_taxonomy_class, revert_language_taxonomy_class),
]