djangosnippets.org: Latest snippets tagged with 'user_passes_test'https://djangosnippets.org/tags/user_passes_test/2018-05-23T13:37:07.609604-05:00Auth decorators with 403 - Django 1.11
2018-05-23T13:37:07.609604-05:00raphaelfvhttps://djangosnippets.org/snippets/10648/<p>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 …</p>
Freely redistributableAuth decorators with 403
2007-05-25T14:58:37.148176-05:00Magushttps://djangosnippets.org/snippets/254/<p>These decorators are based on user_passes_test and permission_required, 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.</p>
Freely redistributable