Skip to content

Commit

Permalink
Fix lt plural rule broken in the initial data migration (mozilla#2993)
Browse files Browse the repository at this point in the history
  • Loading branch information
mathjazz authored Oct 17, 2023
1 parent 5b6af5f commit d970e82
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions pontoon/base/migrations/0047_fix_lt_plural_rule.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Generated by Django 3.2.15 on 2023-10-17 07:09

from django.db import migrations


def fix_lt_plural_rule(apps, schema_editor):
Locale = apps.get_model("base", "Locale")
locale = Locale.objects.get(code="lt")
locale.plural_rule = (
"(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n%100<10 || n%100>=20) ? 1 : 2)"
)
locale.save(update_fields=["plural_rule"])


class Migration(migrations.Migration):

dependencies = [
("base", "0046_projectslughistory"),
]

operations = [
migrations.RunPython(
code=fix_lt_plural_rule,
reverse_code=migrations.RunPython.noop,
),
]

0 comments on commit d970e82

Please sign in to comment.