Check on media['uploader']'s id rather than the username

This skips making an extra query to retrieve the uploader object and
also checks on the canonical ID, which is probably good (even if
indexing should ensure uniqueness there).
This commit is contained in:
Christopher Allan Webber 2011-06-22 13:57:34 -05:00
parent 3a2b22e346
commit 54de443a6a

View File

@ -35,7 +35,7 @@
<a href="{{ request.urlgen('mediagoblin.user_pages.user_home',
user= media.uploader().username) }}">
{{- media.uploader().username }}</a></p>
{% if media.uploader().username == request.user.username %}
{% if media['uploader'] == request.user['_id'] %}
<p><a href="{{ request.urlgen('mediagoblin.edit.edit_media',
user= media.uploader().username,
media= media._id) }}">Edit</a></p>