~widelands-dev/widelands-website/django_staticfiles

« back to all changes in this revision

Viewing changes to wiki/management.py

  • Committer: franku
  • Date: 2018-04-26 20:18:55 UTC
  • mfrom: (489.1.28 widelands)
  • Revision ID: somal@arcor.de-20180426201855-uwt3b8gptpav6wrm
updated code base to fit with django 1.11.12; replaced app tracking with a new middleware

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 noticetypes for wiki ...")
9
9
        notification.create_notice_type('wiki_revision_reverted',
10
10
                                        _('Article Revision Reverted'),
11
11
                                        _('your revision has been reverted'))
13
13
                                        _('Observed Article Changed'),
14
14
                                        _('an article you observe has changed'))
15
15
 
16
 
    # TODO (Franku): post_syncdb is deprecated since Django 1.7
17
 
    # See: https://docs.djangoproject.com/en/1.8/ref/signals/#post-syncdb
18
 
    signals.post_syncdb.connect(create_notice_types,
19
 
                                sender=notification)
20
16
except ImportError:
21
17
    print 'Skipping creation of NoticeTypes as notification app not found'