Commit a0d5fe3f authored by Sébastiaan Versteeg's avatar Sébastiaan Versteeg
Browse files

Merge branch '663-fix-names-of-categories-of-pushnotifications' into 'master'

Resolve "Fix names of categories of pushnotifications"

Closes #663

See merge request !860

(cherry picked from commit ab10c4ca)

6005cf42 Make all names of categories uppercase
parent 5e954eca
from django.db import migrations
def forwards_func(apps, schema_editor):
category = apps.get_model("pushnotifications", "Category")
db_alias = schema_editor.connection.alias
for key in ['general', 'pizza', 'event', 'newsletter',
'sponsor', 'photo', 'board']:
cat = category.objects.using(db_alias).get(key=key)
cat.name_en = cat.name_en.title()
cat.name_nl = cat.name_nl.title()
cat.save()
def reverse_func(apps, schema_editor):
category = apps.get_model("pushnotifications", "Category")
db_alias = schema_editor.connection.alias
for key in ['general', 'pizza', 'event', 'newsletter',
'sponsor', 'photo', 'board']:
cat = category.objects.using(db_alias).get(key=key)
cat.name_en = cat.name_en.lower()
cat.name_nl = cat.name_nl.lower()
cat.save()
class Migration(migrations.Migration):
dependencies = [
('pushnotifications', '0008_scheduledmessage'),
]
operations = [
migrations.RunPython(forwards_func, reverse_func),
]
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