Commit 31d1b812 authored by Joren Vrancken's avatar Joren Vrancken
Browse files

Merge branch 'fix/rename-notification-cat-partners' into 'master'

Rename the notification category for partners

See merge request !912
parents aced2209 11fdaa92
from django.db import migrations
def forwards_func(apps, schema_editor):
category = apps.get_model("pushnotifications", "Category")
db_alias = schema_editor.connection.alias
category.objects.using(db_alias).get(key='sponsor').delete()
category.objects.create(
key='partner',
name_nl='Partners',
name_en='Partners',
)
def reverse_func(apps, schema_editor):
category = apps.get_model("pushnotifications", "Category")
db_alias = schema_editor.connection.alias
category.objects.using(db_alias).get(key='partner').delete()
category.objects.create(
key='sponsor',
name_nl='Sponsor',
name_en='Sponsor',
)
class Migration(migrations.Migration):
dependencies = [
('pushnotifications', '0009_rename_categories'),
]
operations = [
migrations.RunPython(forwards_func, reverse_func),
]
......@@ -80,24 +80,6 @@ class Message(models.Model, metaclass=ModelTranslateMeta):
objects = MessageManager()
GENERAL = 'general'
PIZZA = 'pizza'
EVENT = 'event'
NEWSLETTER = 'newsletter'
PARTNER = 'partner'
PHOTO = 'photo'
BOARD = 'board'
CATEGORIES = (
(GENERAL, _("General")),
(PIZZA, _("Pizza")),
(EVENT, _("Events")),
(NEWSLETTER, _("Newsletter")),
(PARTNER, _("Messages from partners")),
(PHOTO, _("Photos")),
(BOARD, _("Board")),
)
users = models.ManyToManyField(settings.AUTH_USER_MODEL)
title = MultilingualField(
models.CharField,
......
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