Converting the path to subtitle into a tuple

This commit is contained in:
saksham1115 2016-06-28 06:58:22 +00:00
parent 533c7ab44a
commit 2c36555bfe
3 changed files with 14 additions and 1 deletions

View File

@ -580,10 +580,13 @@ def edit_metadata(request, media):
'media':media})
from mediagoblin.tools.subtitles import get_path
@require_active_login
@path_subtitle
def custom_subtitles(request,path=None):
form = forms.CustomizeSubtitlesForm(request.form)
path = get_path(path)
return render_to_response(
request,
"mediagoblin/edit/custom_subtitles.html",

View File

@ -236,7 +236,7 @@
<li>
<a href="{{ request.urlgen('mediagoblin.edit.custom_subtitles',
path=subtitle.filepath) }}">
{{- subtitle.filepath -}}
{{- subtitle.name -}}
</li>
{%- endfor %}
</ul>

View File

@ -0,0 +1,10 @@
import ast
def get_path(path):
"""
Converting the path of the form
x = u'[ "A","B","C" ," D"]'
to
x = ["A", "B", "C", "D"]
"""
return ast.literal_eval(path)