--- a/src/pyams_file/thumbnail.py Fri Mar 20 23:21:06 2015 +0100
+++ b/src/pyams_file/thumbnail.py Wed May 20 12:22:57 2015 +0200
@@ -29,8 +29,8 @@
from pyams_utils.adapter import ContextAdapter, ContextRequestViewAdapter, adapter_config
from pyams_utils.request import check_request
from pyramid.events import subscriber
-from zope.component import adapter
-from zope.interface import implementer, Interface
+from pyramid.threadlocal import get_current_registry
+from zope.interface import Interface
from zope.lifecycleevent import ObjectAddedEvent, ObjectRemovedEvent, ObjectCreatedEvent
from zope.location import locate
@@ -152,7 +152,7 @@
thumbnailer_name = thumbnail_name
options = name = thumbnail_name
# generate and store thumbnail
- registry = check_request().registry
+ registry = get_current_registry()
thumbnailer = registry.queryAdapter(self.image, IThumbnailer, name=thumbnailer_name)
if thumbnailer is not None:
thumbnail_image = thumbnailer.create_thumbnail(options, format)