Caution an admin when they're editing someone else's media.
authorChristopher Allan Webber <cwebber@dustycloud.org>
Sun, 3 Jul 2011 14:26:40 +0000 (09:26 -0500)
committerChristopher Allan Webber <cwebber@dustycloud.org>
Sun, 3 Jul 2011 14:26:40 +0000 (09:26 -0500)
mediagoblin/edit/views.py

index 64fa0eabfd36e2ae4192e59b7b3b65ad57dc6754..f069d8e70c553ddb556c3ed89a6619e222001ab8 100644 (file)
@@ -64,6 +64,14 @@ def edit_media(request, media):
             return redirect(request, "mediagoblin.user_pages.media_home",
                 user=media.uploader()['username'], media=media['slug'])
 
+    if request.user['is_admin'] \
+            and media['uploader'] != request.user['_id'] \
+            and request.method != 'POST':
+        messages.add_message(
+            request, messages.WARNING,
+            'You are editing another user\'s media. Proceed with caution.')
+        
+
     return render_to_response(
         request,
         'mediagoblin/edit/edit.html',