Permalink
Browse files

Fixed the NOTIFICATION_BACKENDS data structure to work more correctly.

  • Loading branch information...
1 parent 3c9d3ce commit 1319b87bea573c8b33a1de1e1b1d67f4698b11dd @brosner brosner committed Apr 19, 2009
Showing with 5 additions and 4 deletions.
  1. +1 −1 notification/backends/__init__.py
  2. +4 −3 notification/models.py
@@ -32,5 +32,5 @@ def load_backends():
# add the backend label and an instantiated backend class to the
# backends list.
backend_instance = getattr(mod, backend_class)(medium_id, spam_sensitivity)
- backends.append((label, medium_id, backend_instance))
+ backends.append(((medium_id, label), backend_instance))
return dict(backends)
View
@@ -52,9 +52,10 @@ class Meta:
NOTICE_MEDIA = []
NOTICE_MEDIA_DEFAULTS = {}
-for backend_label, medium_id, backend in NOTIFICATION_BACKENDS:
- NOTICE_MEDIA.append((medium_id, backend_label))
- NOTICE_MEDIA_DEFAULTS[medium_id] = backend.spam_sensitivity
+for key, backend in NOTIFICATION_BACKENDS.items():
+ # key is a tuple (medium_id, backend_label)
+ NOTICE_MEDIA.append(key)
+ NOTICE_MEDIA_DEFAULTS[key[0]] = backend.spam_sensitivity
class NoticeSetting(models.Model):
"""

0 comments on commit 1319b87

Please sign in to comment.