~widelands-dev/widelands-website/django_staticfiles

« back to all changes in this revision

Viewing changes to wiki/management.py

  • Committer: Holger Rapp
  • Date: 2009-02-20 12:25:18 UTC
  • Revision ID: holgerrapp@gmx.net-20090220122518-feaq34ta973snnct
Imported wikiapp into our repository, because we did some local changes (users must be logged in to edit wiki pages)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
from django.db.models import signals
1
2
 
2
3
from django.utils.translation import ugettext_noop as _
3
4
 
4
5
try:
5
6
    from notification import models as notification
6
7
 
7
 
    def create_notice_types(sender, **kwargs):
8
 
        print("Creating noticetypes for wiki ...")
9
 
        notification.create_notice_type('wiki_revision_reverted',
10
 
                                        _('Article Revision Reverted'),
11
 
                                        _('your revision has been reverted'))
12
 
        notification.create_notice_type('wiki_observed_article_changed',
13
 
                                        _('Observed Article Changed'),
14
 
                                        _('an article you observe has changed'))
15
 
 
 
8
    def create_notice_types(app, created_models, verbosity, **kwargs):
 
9
        notification.create_notice_type("wiki_article_edited",
 
10
                                        _("Article Edited"),
 
11
                                        _("your article has been edited"))
 
12
        notification.create_notice_type("wiki_revision_reverted",
 
13
                                        _("Article Revision Reverted"),
 
14
                                        _("your revision has been reverted"))
 
15
        notification.create_notice_type("wiki_observed_article_changed",
 
16
                                        _("Observed Article Changed"),
 
17
                                        _("an article you observe has changed"))
 
18
 
 
19
 
 
20
    signals.post_syncdb.connect(create_notice_types,
 
21
                                sender=notification)
16
22
except ImportError:
17
 
    print 'Skipping creation of NoticeTypes as notification app not found'
 
23
    print "Skipping creation of NoticeTypes as notification app not found"