~widelands-dev/widelands-website/django_staticfiles

« back to all changes in this revision

Viewing changes to django_messages_wl/management.py

  • Committer: franku
  • Date: 2018-04-03 18:57:40 UTC
  • mto: This revision was merged to the branch mainline in revision 491.
  • Revision ID: somal@arcor.de-20180403185740-kid24y7oa6u6il09
fixed creation of noticetypes -> convert post_syncdb to post_migrate

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/python
 
2
# -*- coding: utf-8 -*-
 
3
 
 
4
from django.conf import settings
 
5
from django.utils.translation import ugettext_lazy as _
 
6
 
 
7
 
 
8
if "notification" in settings.INSTALLED_APPS and getattr(settings, 'DJANGO_MESSAGES_NOTIFY', True):
 
9
    from notification import models as notification
 
10
 
 
11
    def create_notice_types(sender, **kwargs):
 
12
        print("Creating wl specific noticetypes for django-messages ...")
 
13
        notification.create_notice_type("messages_received", _("Message Received"), _("you have received a message"), default=2)
 
14
        notification.create_notice_type("messages_reply_received", _("Reply Received"), _("you have received a reply to a message"), default=2)
 
15
else:
 
16
    print("Skipping creation of NoticeTypes as notification app not found")
 
 
b'\\ No newline at end of file'