src/pyams_media/video.py
changeset 57 7de6abf4258d
parent 51 e96da5ef6539
child 95 b379aa42a359
--- 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):