rename render_to_forbitten to render_to_forbidden. #370
This commit is contained in:
parent
17afa3c5d1
commit
c58d478151
@ -101,13 +101,13 @@ def permission_required(perm, login_url=None):
|
|||||||
if request.user.has_perm(perm):
|
if request.user.has_perm(perm):
|
||||||
return func(request, *args, **kw)
|
return func(request, *args, **kw)
|
||||||
if request.user.is_authenticated():
|
if request.user.is_authenticated():
|
||||||
return render_to_forbitten(request)
|
return render_to_forbidden(request)
|
||||||
return redirect(reverse('user_login'))
|
return redirect(reverse('user_login'))
|
||||||
return wrapper
|
return wrapper
|
||||||
return renderer
|
return renderer
|
||||||
|
|
||||||
|
|
||||||
def render_to_forbitten(request, error=
|
def render_to_forbidden(request, error=
|
||||||
ugettext_lazy("Sorry, you have no rights to see this page.")):
|
ugettext_lazy("Sorry, you have no rights to see this page.")):
|
||||||
return HttpResponseForbidden(render_to_string('403.html',
|
return HttpResponseForbidden(render_to_string('403.html',
|
||||||
{'error': error}, context_instance=RequestContext(request)))
|
{'error': error}, context_instance=RequestContext(request)))
|
||||||
|
@ -52,7 +52,7 @@ from django.views.generic.list import TemplateResponseMixin
|
|||||||
|
|
||||||
from openslides.config.models import config
|
from openslides.config.models import config
|
||||||
|
|
||||||
from openslides.utils.utils import render_to_forbitten, html_strong
|
from openslides.utils.utils import render_to_forbidden, html_strong
|
||||||
from openslides.utils.signals import template_manipulation
|
from openslides.utils.signals import template_manipulation
|
||||||
from openslides.utils.pdf import firstPage, laterPages
|
from openslides.utils.pdf import firstPage, laterPages
|
||||||
|
|
||||||
@ -93,7 +93,7 @@ class PermissionMixin(object):
|
|||||||
return HttpResponseRedirect("%s?next=%s" % (settings.LOGIN_URL,
|
return HttpResponseRedirect("%s?next=%s" % (settings.LOGIN_URL,
|
||||||
path))
|
path))
|
||||||
else:
|
else:
|
||||||
return render_to_forbitten(request)
|
return render_to_forbidden(request)
|
||||||
return _View.dispatch(self, request, *args, **kwargs)
|
return _View.dispatch(self, request, *args, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user