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 <Sebastian@SSpaeth.de>
This commit is contained in:
parent
6b5f1ca79b
commit
60de3209b9
@ -14,18 +14,19 @@
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user