Commit 680271d4 by Ned Batchelder

Correct the darklang migration, since many darklang configs can exist.

parent 607f3bf4
...@@ -14,7 +14,8 @@ def create_dark_lang_config(apps, schema_editor): ...@@ -14,7 +14,8 @@ def create_dark_lang_config(apps, schema_editor):
dark_lang_model = apps.get_model("dark_lang", "DarkLangConfig") dark_lang_model = apps.get_model("dark_lang", "DarkLangConfig")
db_alias = schema_editor.connection.alias db_alias = schema_editor.connection.alias
dark_lang_model.objects.using(db_alias).get_or_create(enabled=True) if not dark_lang_model.objects.using(db_alias).exists():
dark_lang_model.objects.using(db_alias).create(enabled=True)
def remove_dark_lang_config(apps, schema_editor): def remove_dark_lang_config(apps, schema_editor):
"""Write your backwards methods here.""" """Write your backwards methods here."""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment