Permalink
Browse files

Honor the default syncdb verbosity when creating notice types.

To honor all verbosity levels *all* callers of create_notice_types needs to
pass in the verbosity keyword argument from inside create_notice_types.

git-svn-id: http://django-notification.googlecode.com/svn/trunk@125 590c3fc9-4838-0410-bb95-17a0c9b37ca9
  • Loading branch information...
1 parent fa84b80 commit 22c652cda482249fd59b0c6504d074bd33ece368 @brosner brosner committed Dec 30, 2008
Showing with 5 additions and 3 deletions.
  1. +5 −3 notification/models.py
View
8 notification/models.py
@@ -169,7 +169,7 @@ class NoticeQueueBatch(models.Model):
"""
pickled_data = models.TextField()
-def create_notice_type(label, display, description, default=2):
+def create_notice_type(label, display, description, default=2, verbosity=1):
"""
Creates a new NoticeType.
@@ -189,10 +189,12 @@ def create_notice_type(label, display, description, default=2):
updated = True
if updated:
notice_type.save()
- print "Updated %s NoticeType" % label
+ if verbosity > 1:
+ print "Updated %s NoticeType" % label
except NoticeType.DoesNotExist:
NoticeType(label=label, display=display, description=description, default=default).save()
- print "Created %s NoticeType" % label
+ if verbosity > 1:
+ print "Created %s NoticeType" % label
def get_notification_language(user):
"""

0 comments on commit 22c652c

Please sign in to comment.