fixed 5068
authorBoris Bobrov <breton@cynicmansion.ru>
Thu, 19 Mar 2015 23:25:10 +0000 (02:25 +0300)
committerChristopher Allan Webber <cwebber@dustycloud.org>
Wed, 22 Apr 2015 22:20:31 +0000 (17:20 -0500)
mediagoblin/media_types/__init__.py

index 3eeead863e529b7a4633b6df3f2fd5eefc1c10d6..97e4facd18b9e8549012062092702b2831d3843e 100644 (file)
@@ -84,7 +84,7 @@ def get_media_type_and_manager(filename):
 
     This hook is deprecated, 'type_match_handler' should be used instead
     '''
 
     This hook is deprecated, 'type_match_handler' should be used instead
     '''
-    if filename.find('.') > 0:
+    if os.path.basename(filename).find('.') > 0:
         # Get the file extension
         ext = os.path.splitext(filename)[1].lower()
 
         # Get the file extension
         ext = os.path.splitext(filename)[1].lower()
 
@@ -106,7 +106,7 @@ def type_match_handler(media_file, filename):
     specifically. After that, if media type is one of supported ones, check the
     contents of the file
     '''
     specifically. After that, if media type is one of supported ones, check the
     contents of the file
     '''
-    if filename.find('.') > 0:
+    if os.path.basename(filename).find('.') > 0:
         # Get the file extension
         ext = os.path.splitext(filename)[1].lower()
 
         # Get the file extension
         ext = os.path.splitext(filename)[1].lower()