-
-
Save ozten/1435969 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.contrib.auth import REDIRECT_FIELD_NAME | |
from django.contrib.auth.decorators import (login_required as | |
auth_login_required) | |
def login_required(function=None, | |
redirect_field_name=REDIRECT_FIELD_NAME, | |
login_url='/'): | |
"""BrowserID sepcific login_required decorator. | |
Decorator for views that checks that the user is logged in, redirecting | |
to the log-in page if necessary. | |
""" | |
return auth_login_required( | |
function=function, | |
redirect_field_name=redirect_field_name, | |
login_url=login_url) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment