from routes.route import Route
edit_routes = [
- Route('mediagoblin.edit.edit_media', "/{media}/",
+ Route('mediagoblin.edit.edit_media', "/{user}/{media}/",
controller="mediagoblin.edit.views:edit_media"),
]
from webob import Response, exc
from mediagoblin.edit import forms
-from mediagoblin.decorators import require_active_login, get_media_entry_by_id
+from mediagoblin.decorators import require_active_login, get_user_media_entry
def may_edit_media(request, media):
return False
-@get_media_entry_by_id
+@get_user_media_entry
@require_active_login
def edit_media(request, media):
if not may_edit_media(request, media):
<h1>Edit details for {{ media.title }}</h1>
<form action="{{ request.urlgen('mediagoblin.edit.edit_media',
+ user= media.uploader().username,
media= media._id) }}"
method="POST" enctype="multipart/form-data">
<div class="submit_box form_box">
user= media.uploader().username) }}">
{{- media.uploader().username }}</a></p>
<p><a href="{{ request.urlgen('mediagoblin.edit.edit_media',
+ user= media.uploader().username,
media= media._id) }}">Edit</a></p>
{% else %}
<p>Sorry, no such media found.<p/>