~widelands-dev/widelands-website/trunk

« back to all changes in this revision

Viewing changes to django_messages_wl/management.py

  • Committer: Holger Rapp
  • Date: 2019-06-21 18:34:42 UTC
  • mfrom: (540.1.3 update_ops_script)
  • Revision ID: sirver@gmx.de-20190621183442-y2ulybzr0rdvfefd
Adapt the update script for the new server.

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', _(
 
14
            'Message Received'), _('you have received a message'), default=2)
 
15
        notification.create_notice_type('messages_reply_received', _(
 
16
            'Reply Received'), _('you have received a reply to a message'), default=2)
 
17
else:
 
18
    print('Skipping creation of NoticeTypes as notification app not found')