Skip to content
Browse files

added missing function

  • Loading branch information...
1 parent 26479c5 commit c8949abd6f5124f64a7f137af56d3f8686da21e5 @paltman paltman committed Jun 23, 2011
Showing with 10 additions and 0 deletions.
  1. +10 −0 notification/models.py
View
10 notification/models.py
@@ -105,6 +105,16 @@ def for_user(cls, user, notice_type, medium):
return setting
+def get_notification_setting(user, notice_type, medium):
+ try:
+ return NoticeSetting.objects.get(user=user, notice_type=notice_type, medium=medium)
+ except NoticeSetting.DoesNotExist:
+ default = (NOTICE_MEDIA_DEFAULTS[medium] <= notice_type.default)
+ setting = NoticeSetting(user=user, notice_type=notice_type, medium=medium, send=default)
+ setting.save()
+ return setting
+
+
class NoticeQueueBatch(models.Model):
"""
A queued notice.

0 comments on commit c8949ab

Please sign in to comment.
Something went wrong with that request. Please try again.