diff options
author | saksham1115 <saksham115@gmail.com> | 2016-06-28 06:58:22 +0000 |
---|---|---|
committer | saksham1115 <saksham115@gmail.com> | 2016-07-19 17:29:09 +0000 |
commit | 2c36555bfe4b21880d82b95c4c7a676967f10f96 (patch) | |
tree | 2a697f7f7eba14bb0835c508497919d444069660 | |
parent | 533c7ab44a6210f4734b77d5785c5825d70e0c36 (diff) | |
download | mediagoblin-2c36555bfe4b21880d82b95c4c7a676967f10f96.tar.lz mediagoblin-2c36555bfe4b21880d82b95c4c7a676967f10f96.tar.xz mediagoblin-2c36555bfe4b21880d82b95c4c7a676967f10f96.zip |
Converting the path to subtitle into a tuple
-rw-r--r-- | mediagoblin/edit/views.py | 3 | ||||
-rw-r--r-- | mediagoblin/templates/mediagoblin/user_pages/media.html | 2 | ||||
-rw-r--r-- | mediagoblin/tools/subtitles.py | 10 |
3 files changed, 14 insertions, 1 deletions
diff --git a/mediagoblin/edit/views.py b/mediagoblin/edit/views.py index 6d3e684b..33643bf8 100644 --- a/mediagoblin/edit/views.py +++ b/mediagoblin/edit/views.py @@ -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", diff --git a/mediagoblin/templates/mediagoblin/user_pages/media.html b/mediagoblin/templates/mediagoblin/user_pages/media.html index a44f6377..3d28cf76 100644 --- a/mediagoblin/templates/mediagoblin/user_pages/media.html +++ b/mediagoblin/templates/mediagoblin/user_pages/media.html @@ -236,7 +236,7 @@ <li> <a href="{{ request.urlgen('mediagoblin.edit.custom_subtitles', path=subtitle.filepath) }}"> - {{- subtitle.filepath -}} + {{- subtitle.name -}} </li> {%- endfor %} </ul> diff --git a/mediagoblin/tools/subtitles.py b/mediagoblin/tools/subtitles.py new file mode 100644 index 00000000..7002cdfc --- /dev/null +++ b/mediagoblin/tools/subtitles.py @@ -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)
\ No newline at end of file |