From: saksham1115 Date: Wed, 13 Jul 2016 15:09:49 +0000 (+0000) Subject: Only video uploader can edit their subtitles X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=772a07e94f037f62f013aca376019989ebf8cb28;p=mediagoblin.git Only video uploader can edit their subtitles --- 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