Skip to content

Instantly share code, notes, and snippets.

@gone
Created April 15, 2015 00:41
Show Gist options
  • Save gone/fb24cbe933428fe89ea9 to your computer and use it in GitHub Desktop.
Save gone/fb24cbe933428fe89ea9 to your computer and use it in GitHub Desktop.
if page:
if page.login_required and not request.user.is_authenticated():
return redirect_to_login(urlquote(request.get_full_path()), settings.LOGIN_URL)
if not page.has_view_permission(request):
return _handle_no_page(request, "$")
return func(request, *args, **kwargs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment