From 772a07e94f037f62f013aca376019989ebf8cb28 Mon Sep 17 00:00:00 2001 From: saksham1115 Date: Wed, 13 Jul 2016 15:09:49 +0000 Subject: [PATCH] Only video uploader can edit their subtitles --- mediagoblin/edit/views.py | 4 +++- mediagoblin/templates/mediagoblin/user_pages/media.html | 4 +++- mediagoblin/user_pages/routing.py | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/mediagoblin/edit/views.py b/mediagoblin/edit/views.py index 6b22fbae..eb9334e9 100644 --- a/mediagoblin/edit/views.py +++ b/mediagoblin/edit/views.py @@ -584,8 +584,10 @@ def edit_metadata(request, media): from mediagoblin.tools.subtitles import open_subtitle,save_subtitle @require_active_login +@get_media_entry_by_id +@user_may_delete_media @path_subtitle -def custom_subtitles(request,path=None): +def custom_subtitles(request,media,path=None): text = open_subtitle(path) form = forms.CustomizeSubtitlesForm(request.form, subtitle=text) diff --git a/mediagoblin/templates/mediagoblin/user_pages/media.html b/mediagoblin/templates/mediagoblin/user_pages/media.html index f7997571..2ba561dd 100644 --- a/mediagoblin/templates/mediagoblin/user_pages/media.html +++ b/mediagoblin/templates/mediagoblin/user_pages/media.html @@ -236,8 +236,10 @@ {%- for subtitle in media.subtitle_files %}
  • - {{- subtitle.name -}} + {{- subtitle.name -}}
  • {%- endfor %} diff --git a/mediagoblin/user_pages/routing.py b/mediagoblin/user_pages/routing.py index 0165ab6c..beb16a0f 100644 --- a/mediagoblin/user_pages/routing.py +++ b/mediagoblin/user_pages/routing.py @@ -122,5 +122,5 @@ add_route('mediagoblin.edit.metadata', add_route('mediagoblin.edit.custom_subtitles', - '/c_s/', + '/u//m//c_s/', 'mediagoblin.edit.views:custom_subtitles') \ No newline at end of file -- 2.25.1