From: Christopher Allan Webber Date: Sun, 3 Jul 2011 14:26:40 +0000 (-0500) Subject: Caution an admin when they're editing someone else's media. X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=96a2c366427f288ba3c2e20789612d829a55e908;p=mediagoblin.git Caution an admin when they're editing someone else's media. --- diff --git a/mediagoblin/edit/views.py b/mediagoblin/edit/views.py index 64fa0eab..f069d8e7 100644 --- a/mediagoblin/edit/views.py +++ b/mediagoblin/edit/views.py @@ -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',