# HG changeset patch # User Sverre Rabbelier # Date 1242421513 -7200 # Node ID 3eee2308f1dd2030a82740448a4a702ef9ccc28f # Parent 594b55099fabe99af02b62c69cd863e55774ce7f 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. diff -r 594b55099fab -r 3eee2308f1dd app/soc/logic/helper/notifications.py --- 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'],