Better handle 403 with next argument

This commit is contained in:
Skia
2016-08-07 20:36:06 +02:00
parent a0f7150c55
commit ad36c1c6f6
4 changed files with 18 additions and 6 deletions

View File

@ -3,11 +3,13 @@ from django.shortcuts import render
from django.http import HttpResponseForbidden, HttpResponseNotFound
from django.core.exceptions import PermissionDenied, ObjectDoesNotExist
from django.views.generic.base import View
from django.contrib.auth.forms import AuthenticationForm
from core.models import Group
def forbidden(request):
return HttpResponseForbidden(render(request, "core/403.jinja"))
return HttpResponseForbidden(render(request, "core/403.jinja", context={'next': request.path, 'form':
AuthenticationForm()}))
def not_found(request):
return HttpResponseNotFound(render(request, "core/404.jinja"))