Ticket #5068: issue_5068.patch

File issue_5068.patch, 1.1 KB (added by Boris Bobrov, 9 years ago)
  • mediagoblin/media_types/__init__.py

    From 6dc847d0755f831b1df57b2f4ac54285dca60e9c Mon Sep 17 00:00:00 2001
    From: Boris Bobrov <breton@cynicmansion.ru>
    Date: Fri, 20 Mar 2015 02:25:10 +0300
    Subject: [PATCH] fixed 5068
    
    ---
     mediagoblin/media_types/__init__.py |    4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/mediagoblin/media_types/__init__.py b/mediagoblin/media_types/__init__.py
    index 3eeead8..97e4fac 100644
    a b def get_media_type_and_manager(filename):  
    8484
    8585    This hook is deprecated, 'type_match_handler' should be used instead
    8686    '''
    87     if filename.find('.') > 0:
     87    if os.path.basename(filename).find('.') > 0:
    8888        # Get the file extension
    8989        ext = os.path.splitext(filename)[1].lower()
    9090
    def type_match_handler(media_file, filename):  
    106106    specifically. After that, if media type is one of supported ones, check the
    107107    contents of the file
    108108    '''
    109     if filename.find('.') > 0:
     109    if os.path.basename(filename).find('.') > 0:
    110110        # Get the file extension
    111111        ext = os.path.splitext(filename)[1].lower()
    112112