Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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...
commit 22c652cda482249fd59b0c6504d074bd33ece368 1 parent fa84b80
@brosner brosner authored
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):
"""
Please sign in to comment.
Something went wrong with that request. Please try again.