Commit 152977bd authored by Dmitry Shelepnev's avatar Dmitry Shelepnev
Browse files

Fix error in sopds_login decorator (enabled auth with SOPDS_AUTH=False)

parent ef9fb4da
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -19,12 +19,12 @@ from sopds_web_backend.settings import HALF_PAGES_LINKS

def sopds_login(function=None, redirect_field_name=REDIRECT_FIELD_NAME, url=None):
    actual_decorator = user_passes_test(
        lambda u: u.is_authenticated(),
        lambda u: (u.is_authenticated() if AUTH else True),
        login_url=reverse_lazy(url),
        redirect_field_name=redirect_field_name
    ) 
    if function:
        return actual_decorator(function) if AUTH else function
        return actual_decorator(function)
    return actual_decorator

def sopds_processor(request):