"""
def wrapper(request, *args, **kwargs):
uploader = request.db.MediaEntry.find_one(
- {'_id': ObjectId(request.matchdict['media'])}).uploader()
+ {'slug': request.matchdict['media'] }).uploader()
if not (request.user['is_admin'] or
request.user['_id'] == uploader['_id']):
return exc.HTTPForbidden()
if not user:
return render_404(request)
-
media = request.db.MediaEntry.find_one(
{'slug': request.matchdict['media'],
'state': 'processed',
<p>
{% set edit_url = request.urlgen('mediagoblin.edit.edit_media',
user= media.uploader().username,
- media= media._id) %}
+ media= media.slug) %}
<a href="{{ edit_url }}"
><img src="{{ request.staticdirect('/images/icon_edit.png') }}"
class="media_icon" /></a>
<p>
{% set delete_url = request.urlgen('mediagoblin.user_pages.media_confirm_delete',
user= media.uploader().username,
- media= media._id) %}
+ media= media.slug) %}
<a href="{{ delete_url }}"
><img src="{{ request.staticdirect('/images/icon_delete.png') }}"
class="media_icon" /></a>
<form action="{{ request.urlgen('mediagoblin.user_pages.media_confirm_delete',
user=media.uploader().username,
- media=media._id) }}"
+ media=media.slug) }}"
method="POST" enctype="multipart/form-data">
<div class="grid_8 prefix_1 suffix_1 edit_box form_box">
<h1>