Skip to content

Commit

Permalink
fixed missing variable in send
Browse files Browse the repository at this point in the history
  • Loading branch information
brosner committed Mar 17, 2011
1 parent 8b76270 commit d96a39e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion notification/models.py
Expand Up @@ -16,6 +16,9 @@
from notification.message import encode_message


DEFAULT_QUEUE_ALL = False


class LanguageStoreNotAvailable(Exception):
pass

Expand Down Expand Up @@ -173,6 +176,7 @@ def send(*args, **kwargs):
be queued or not. A per call ``queue`` or ``now`` keyword argument can be
used to always override the default global behavior.
"""
QUEUE_ALL = getattr(settings, "NOTIFICATION_QUEUE_ALL", DEFAULT_QUEUE_ALL)
queue_flag = kwargs.pop("queue", False)
now_flag = kwargs.pop("now", False)
assert not (queue_flag and now_flag), "'queue' and 'now' cannot both be True."
Expand All @@ -193,7 +197,7 @@ def queue(users, label, extra_context=None, sender=None):
of user notifications to be deferred to a seperate process running outside
the webserver.
"""
QUEUE_ALL = getattr(settings, "NOTIFICATION_QUEUE_ALL", False)
QUEUE_ALL = getattr(settings, "NOTIFICATION_QUEUE_ALL", DEFAULT_QUEUE_ALL)
if extra_context is None:
extra_context = {}
if isinstance(users, QuerySet):
Expand Down

0 comments on commit d96a39e

Please sign in to comment.