Login

Snippets by raphaelfv

Snippet List

Auth decorators with 403 - Django 1.11

This decorator is based on user_passes_test, but when a user is logged in and fails the test, it will render a 403 error instead of redirecting to login - only anonymous users will be asked to login. Version working with Django 1.11, based on version found on [https://djangosnippets.org/snippets/254/] , which is deprecated.

  • auth
  • user_passes_test
  • 403 permission_required
Read More

raphaelfv has posted 1 snippet.