From 60de3209b923db71fc126bca4c34e0bf34752726 Mon Sep 17 00:00:00 2001 From: Sebastian Spaeth Date: Thu, 15 Nov 2012 15:41:06 +0100 Subject: [PATCH] Return code 403 when accessing admin pages without being an admin. Previously we were just returning a 404 page and this confused the heck out of me, as I did not understand why the admin pages were not there at all (I was no admin). Signed-off-by: Sebastian Spaeth --- mediagoblin/admin/views.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mediagoblin/admin/views.py b/mediagoblin/admin/views.py index e6a3eac3..9c14c55c 100644 --- a/mediagoblin/admin/views.py +++ b/mediagoblin/admin/views.py @@ -14,18 +14,19 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . -from mediagoblin.tools.response import render_to_response, render_404 from mediagoblin.db.util import DESCENDING from mediagoblin.decorators import require_active_login - +from mediagoblin.tools.response import (render_to_response, render_403, + render_404) @require_active_login def admin_processing_panel(request): ''' Show the global processing panel for this instance ''' + # TODO: Why not a "require_admin_login" decorator throwing a 403 exception? if not request.user.is_admin: - return render_404(request) + return render_403(request) processing_entries = request.db.MediaEntry.find( {'state': u'processing'}).sort('created', DESCENDING) -- 2.25.1