From c36c6833046b6d1f6aa1b0f274585a1b23b9a5ad Mon Sep 17 00:00:00 2001 From: saksham1115 Date: Tue, 19 Jul 2016 18:15:36 +0000 Subject: [PATCH] Removed path_subtitle as a decorator --- mediagoblin/decorators.py | 24 ------------------- mediagoblin/plugins/custom_subtitles/views.py | 9 ++++--- 2 files changed, 4 insertions(+), 29 deletions(-) diff --git a/mediagoblin/decorators.py b/mediagoblin/decorators.py index 30916f14..daeddb3f 100644 --- a/mediagoblin/decorators.py +++ b/mediagoblin/decorators.py @@ -120,30 +120,6 @@ def active_user_from_url(controller): return wrapper -def path_subtitle(controller): - """Retrieve URL pattern and pass in as path=...""" - - - @wraps(controller) - def wrapper(request, *args, **kwargs): - path_sub = request.matchdict['path'] - - return controller(request, *args, path=path_sub, **kwargs) - - return wrapper - -def path_subtitle(controller): - """Retrieve URL pattern and pass in as path=...""" - - - @wraps(controller) - def wrapper(request, *args, **kwargs): - path_sub = request.matchdict['path'] - - return controller(request, *args, path=path_sub, **kwargs) - - return wrapper - def user_may_delete_media(controller): """ diff --git a/mediagoblin/plugins/custom_subtitles/views.py b/mediagoblin/plugins/custom_subtitles/views.py index fdda5b37..5ea9cf35 100644 --- a/mediagoblin/plugins/custom_subtitles/views.py +++ b/mediagoblin/plugins/custom_subtitles/views.py @@ -27,7 +27,7 @@ from mediagoblin import mg_globals from mediagoblin.plugins.custom_subtitles import forms from mediagoblin.decorators import (require_active_login, active_user_from_url, - get_media_entry_by_id, path_subtitle, user_may_delete_media) + get_media_entry_by_id, user_may_delete_media) from mediagoblin.tools.metadata import (compact_and_validate, DEFAULT_CHECKER, DEFAULT_SCHEMA) from mediagoblin.tools.response import (render_to_response, @@ -101,8 +101,8 @@ def edit_subtitles(request, media): @require_active_login @get_media_entry_by_id @user_may_delete_media -@path_subtitle def custom_subtitles(request,media,path=None): + path = request.matchdict['path'] text="" text = open_subtitle(path) form = forms.CustomizeSubtitlesForm(request.form, @@ -132,9 +132,8 @@ def custom_subtitles(request,media,path=None): @require_active_login @get_media_entry_by_id @user_may_delete_media -@path_subtitle -def delete_subtitles(request,media,path=None): - +def delete_subtitles(request,media): + path = request.matchdict['path'] path = get_path(path) mg_globals.public_store.delete_file(path) delete_container = None -- 2.25.1