diff options
author | Boris Bobrov <breton@cynicmansion.ru> | 2018-07-11 16:54:08 +0200 |
---|---|---|
committer | Boris Bobrov <breton@cynicmansion.ru> | 2018-07-11 16:54:08 +0200 |
commit | 5430bc2cdd513df8b27856b0d47999b3deac3622 (patch) | |
tree | c53aee8148c447fa61bd08d474c6f782b6e02ae7 /mediagoblin/plugins | |
parent | 4024bcddf9871d33ee8f528c5f6d131c4e386b2e (diff) | |
download | mediagoblin-5430bc2cdd513df8b27856b0d47999b3deac3622.tar.lz mediagoblin-5430bc2cdd513df8b27856b0d47999b3deac3622.tar.xz mediagoblin-5430bc2cdd513df8b27856b0d47999b3deac3622.zip |
remove requirement for the file to be with single dot in name
Diffstat (limited to 'mediagoblin/plugins')
-rw-r--r-- | mediagoblin/plugins/subtitles/views.py | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/mediagoblin/plugins/subtitles/views.py b/mediagoblin/plugins/subtitles/views.py index 7d41a36d..46b844af 100644 --- a/mediagoblin/plugins/subtitles/views.py +++ b/mediagoblin/plugins/subtitles/views.py @@ -61,15 +61,7 @@ def edit_subtitles(request, media): public_filename = secure_filename( request.files['subtitle_file'].filename) filepath = request.files['subtitle_file'].filename - if filepath.count('.') != 1: # Not allowing double extensions or no extensions - messages.add_message( - request, - messages.ERROR, - ("Check the filename")) - - return redirect(request, - location=media.url_for_self(request.urlgen)) - elif filepath.split('.')[-1] not in allowed_extensions : + if filepath.split('.')[-1] not in allowed_extensions : messages.add_message( request, messages.ERROR, @@ -77,8 +69,7 @@ def edit_subtitles(request, media): return redirect(request, location=media.url_for_self(request.urlgen)) - subtitle_public_filepath \ - = mg_globals.public_store.get_unique_filepath( + subtitle_public_filepath = mg_globals.public_store.get_unique_filepath( ['media_entries', six.text_type(media.id), 'subtitle', public_filename]) |