From 96a2c366427f288ba3c2e20789612d829a55e908 Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Sun, 3 Jul 2011 09:26:40 -0500 Subject: [PATCH] Caution an admin when they're editing someone else's media. --- mediagoblin/edit/views.py | 8 ++++++++ 1 file changed, 8 insertions(+) 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', -- 2.25.1