~widelands-dev/widelands-website/django_staticfiles

« back to all changes in this revision

Viewing changes to wlmaps/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
 
from django.db.models import signals
2
1
 
3
2
from django.utils.translation import ugettext_noop as _
4
3
 
5
4
try:
6
5
    from notification import models as notification
7
6
 
8
 
    def create_notice_types(app, created_models, verbosity, **kwargs):
 
7
    def create_notice_types(sender, **kwargs):
 
8
        print('Creating notice types for maps ...')
9
9
        notification.create_notice_type('maps_new_map',
10
10
                                        _('A new Map is available'),
11
 
                                        _('a new map is available for download'),1)
12
 
 
13
 
    signals.post_migrate.connect(create_notice_types,
14
 
                                sender=notification)
 
11
                                        _('a new map is available for download'), 1)
15
12
except ImportError:
16
13
    print 'Skipping creation of NoticeTypes as notification app not found'