Converting the path to subtitle into a tuple
This commit is contained in:
parent
533c7ab44a
commit
2c36555bfe
@ -580,10 +580,13 @@ def edit_metadata(request, media):
|
|||||||
'media':media})
|
'media':media})
|
||||||
|
|
||||||
|
|
||||||
|
from mediagoblin.tools.subtitles import get_path
|
||||||
|
|
||||||
@require_active_login
|
@require_active_login
|
||||||
@path_subtitle
|
@path_subtitle
|
||||||
def custom_subtitles(request,path=None):
|
def custom_subtitles(request,path=None):
|
||||||
form = forms.CustomizeSubtitlesForm(request.form)
|
form = forms.CustomizeSubtitlesForm(request.form)
|
||||||
|
path = get_path(path)
|
||||||
return render_to_response(
|
return render_to_response(
|
||||||
request,
|
request,
|
||||||
"mediagoblin/edit/custom_subtitles.html",
|
"mediagoblin/edit/custom_subtitles.html",
|
||||||
|
@ -236,7 +236,7 @@
|
|||||||
<li>
|
<li>
|
||||||
<a href="{{ request.urlgen('mediagoblin.edit.custom_subtitles',
|
<a href="{{ request.urlgen('mediagoblin.edit.custom_subtitles',
|
||||||
path=subtitle.filepath) }}">
|
path=subtitle.filepath) }}">
|
||||||
{{- subtitle.filepath -}}
|
{{- subtitle.name -}}
|
||||||
</li>
|
</li>
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
|
10
mediagoblin/tools/subtitles.py
Normal file
10
mediagoblin/tools/subtitles.py
Normal 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)
|
Loading…
x
Reference in New Issue
Block a user