Changed registry access
authorThierry Florac <thierry.florac@onf.fr>
Wed, 20 May 2015 12:30:17 +0200
changeset 38 cadf156a926e
parent 37 0d2d78573a9b
child 39 51a07039228f
Changed registry access
src/pyams_security/notification.py
--- a/src/pyams_security/notification.py	Wed May 20 12:29:38 2015 +0200
+++ b/src/pyams_security/notification.py	Wed May 20 12:30:17 2015 +0200
@@ -23,7 +23,7 @@
 # import packages
 from persistent import Persistent
 from pyams_utils.adapter import adapter_config
-from pyams_utils.request import check_request
+from pyramid.threadlocal import get_current_registry
 from zope.interface import implementer
 from zope.lifecycleevent import ObjectCreatedEvent
 from zope.schema.fieldproperty import FieldProperty
@@ -53,5 +53,5 @@
     settings = annotations.get(NOTIFICATIONS_KEY)
     if settings is None:
         settings = annotations[NOTIFICATIONS_KEY] = NotificationSettings()
-        check_request().registry.notify(ObjectCreatedEvent(settings))
+        get_current_registry().notify(ObjectCreatedEvent(settings))
     return settings