Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace deprecated django.utils.decorators.available_attrs #67

Merged
merged 1 commit into from Aug 27, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions lazysignup/decorators.py
Expand Up @@ -6,7 +6,7 @@
from django.contrib.auth import get_user
from django.contrib.auth import login
from django.shortcuts import redirect
from django.utils.decorators import available_attrs
from functools import WRAPPER_ASSIGNMENTS

from lazysignup.constants import USER_AGENT_BLACKLIST
from lazysignup.utils import is_lazy_user
Expand Down Expand Up @@ -51,7 +51,7 @@ def wrapped(request, *args, **kwargs):

def require_lazy_user(*redirect_args, **redirect_kwargs):
def decorator(func):
@wraps(func, assigned=available_attrs(func))
@wraps(func, assigned=WRAPPER_ASSIGNMENTS)
def inner(request, *args, **kwargs):
if is_lazy_user(request.user):
return func(request, *args, **kwargs)
Expand All @@ -63,7 +63,7 @@ def inner(request, *args, **kwargs):

def require_nonlazy_user(*redirect_args, **redirect_kwargs):
def decorator(func):
@wraps(func, assigned=available_attrs(func))
@wraps(func, assigned=WRAPPER_ASSIGNMENTS)
def inner(request, *args, **kwargs):
if not is_lazy_user(request.user):
return func(request, *args, **kwargs)
Expand Down