forked from openedx/edx-platform
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: remove Taxonomy.required, make allow_multiple True by default
- Loading branch information
1 parent
0a6eb51
commit 1ec1985
Showing
11 changed files
with
72 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
openedx/core/djangoapps/content_tagging/migrations/0007_system_defined_org_2.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
from django.db import migrations | ||
|
||
|
||
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) | ||
|
||
|
||
def revert_mark_language_taxonomy_as_all_orgs(apps, _schema_editor): | ||
""" | ||
Deletes association of system defined taxonomy Language (id=-1) to all orgs. | ||
""" | ||
TaxonomyOrg = apps.get_model("content_tagging", "TaxonomyOrg") | ||
TaxonomyOrg.objects.get(taxonomy_id=-1, org=None).delete() | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
('content_tagging', '0006_simplify_models'), | ||
("oel_tagging", "0012_language_taxonomy"), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython(mark_language_taxonomy_as_all_orgs, revert_mark_language_taxonomy_as_all_orgs), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters