From 9c0b17a9ae4cc010cfeb5897ab501217c120d6c1 Mon Sep 17 00:00:00 2001 From: Skia Date: Mon, 2 May 2016 11:33:38 +0200 Subject: [PATCH] Fix custom special views 403,404 to return the right HTTP code --- core/views/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/views/__init__.py b/core/views/__init__.py index ff19e750..d18c0717 100644 --- a/core/views/__init__.py +++ b/core/views/__init__.py @@ -1,16 +1,16 @@ from django.shortcuts import render -from django.http import HttpResponseForbidden +from django.http import HttpResponseForbidden, HttpResponseNotFound from django.core.exceptions import PermissionDenied, ObjectDoesNotExist from django.views.generic.base import View from core.models import Group def forbidden(request): - return render(request, "core/403.jinja") + return HttpResponseForbidden(render(request, "core/403.jinja")) def not_found(request): - return render(request, "core/404.jinja") + return HttpResponseNotFound(render(request, "core/404.jinja")) def can_edit_prop(obj, user): if obj is None or user.is_owner(obj):