Skip to content

Commit

Permalink
Fix french and spanish language names to fit the field choices (#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
emilekm authored Jun 15, 2021
1 parent 32a549e commit 4da5c1f
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions search/migrations/0020_fix_fra_and_hisz_lang_names.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Generated by Django 3.0.7 on 2021-06-15 14:25

from django.db import migrations

from search.models import LanguageName


def forwards_func(apps, schema):
Language = apps.get_model("search", "Language")

Language.objects.filter(name="franc").update(name=LanguageName.FRA[0])
Language.objects.filter(name="hiszp").update(name=LanguageName.HISZ[0])


def reverse_func(apps, schema):
Language = apps.get_model("search", "Language")

Language.objects.filter(name=LanguageName.FRA[0]).update(name="franc")
Language.objects.filter(name=LanguageName.HISZ[0]).update(name="hiszp")


class Migration(migrations.Migration):

dependencies = [
("search", "0019_insert_scores_2020"),
]

operations = [migrations.RunPython(forwards_func, reverse_func)]

0 comments on commit 4da5c1f

Please sign in to comment.