--- a/src/pyams_media/media.py Wed Sep 20 14:05:49 2017 +0200
+++ b/src/pyams_media/media.py Thu Sep 21 12:42:23 2017 +0200
@@ -140,14 +140,14 @@
return IMediaConversions(self.context)
-@adapter_config(name='conversions', context=(IFile, Interface, Interface), provides=ITALESExtension)
+@adapter_config(name='conversions', context=(Interface, Interface, Interface), provides=ITALESExtension)
class ConversionsExtension(ContextRequestViewAdapter):
"""extension:conversions(media) TALES extension"""
def render(self, context=None):
if context is None:
context = self.context
- return IMediaConversions(context)
+ return IMediaConversions(context, None)
#
--- a/src/pyams_media/video.py Wed Sep 20 14:05:49 2017 +0200
+++ b/src/pyams_media/video.py Thu Sep 21 12:42:23 2017 +0200
@@ -195,13 +195,15 @@
return 'video/flash'
-@adapter_config(name='video_type', context=(IVideo, Interface, Interface), provides=ITALESExtension)
+@adapter_config(name='video_type', context=(Interface, Interface, Interface), provides=ITALESExtension)
class VideoTypeExtension(ContextRequestViewAdapter):
"""extension:video_type(media) TALES extension"""
def render(self, context=None):
if context is None:
context = self.context
+ if not IVideo.providedBy(context):
+ return None
registry = self.request.registry
content_type = context.content_type
if isinstance(content_type, bytes):