Check user['_id'] instead of username, which is slightly more guaranteed
authorChristopher Allan Webber <cwebber@dustycloud.org>
Mon, 4 Jul 2011 13:47:02 +0000 (08:47 -0500)
committerChristopher Allan Webber <cwebber@dustycloud.org>
Mon, 4 Jul 2011 13:47:02 +0000 (08:47 -0500)
mediagoblin/templates/mediagoblin/user_pages/user.html

index 96b6b9d1efddea3d896c8bc2a36c200eabb7cdbe..ba61e52f04876c98625de78b74ea36a1e941b644 100644 (file)
@@ -27,9 +27,9 @@
 {% block mediagoblin_content -%}
   {% if user %}
     <h1>{{ user.username }}'s profile</h1>
-    {% if request.user.username == user.username or request.user['is_admin'] %}
+    {% if request.user['_id'] == user['_id'] or request.user['is_admin'] %}
        <a href="{{ request.urlgen('mediagoblin.edit.profile') }}?username={{ 
-           user.username }}"> Edit</a>
+           user.username }}">Edit profile</a>
     {% endif %}
     
     {% include "mediagoblin/utils/profile.html" %}