Do not rely on notifiction module being imported
This has worked so far mostly by accident, but it turned out to be
brittle while writing tests. This makes sure that the notification
module is always imported before use.
--- a/app/soc/logic/helper/notifications.py Fri May 15 20:54:36 2009 +0200
+++ b/app/soc/logic/helper/notifications.py Fri May 15 23:05:13 2009 +0200
@@ -191,6 +191,7 @@
'scope_path': to_user.link_id
}
+ import soc.logic.models.notification
key_name = model_logic.notification.logic.getKeyNameFromFields(fields)
# create and put a new notification in the datastore
@@ -204,6 +205,8 @@
notification_entity: Notification about which the message should be sent
"""
+ import soc.views.models.notification
+
# create the url to show this notification
notification_url = "http://%(host)s%(index)s" % {
'host' : os.environ['HTTP_HOST'],