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:
parent
3a2b22e346
commit
54de443a6a
@ -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>
|
||||
|
Loading…
x
Reference in New Issue
Block a user