Ticket #13714: login_required_login_url.diff

File login_required_login_url.diff, 841 bytes (added by mhlakhani, 14 years ago)

The required patch.

  • django/contrib/auth/decorators.py

     
    3030    return decorator
    3131
    3232
    33 def login_required(function=None, redirect_field_name=REDIRECT_FIELD_NAME):
     33def login_required(function=None, redirect_field_name=REDIRECT_FIELD_NAME, login_url=None,):
    3434    """
    3535    Decorator for views that checks that the user is logged in, redirecting
    3636    to the log-in page if necessary.
    3737    """
    3838    actual_decorator = user_passes_test(
    3939        lambda u: u.is_authenticated(),
    40         redirect_field_name=redirect_field_name
     40        redirect_field_name=redirect_field_name,
     41        login_url = login_url
    4142    )
    4243    if function:
    4344        return actual_decorator(function)
Back to Top