From 9fda268853b013e80ca7b5baf532377e095f1653 Mon Sep 17 00:00:00 2001 From: Jennifer Richards Date: Mon, 8 May 2023 15:19:33 -0300 Subject: [PATCH] fix: Replace `available_attrs` helper (dropped by Django 3.0) --- ietf/ietfauth/utils.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ietf/ietfauth/utils.py b/ietf/ietfauth/utils.py index 029342e7f..702b0199d 100644 --- a/ietf/ietfauth/utils.py +++ b/ietf/ietfauth/utils.py @@ -7,7 +7,7 @@ import oidc_provider.lib.claims -from functools import wraps +from functools import wraps, WRAPPER_ASSIGNMENTS from django.conf import settings from django.contrib.auth import REDIRECT_FIELD_NAME @@ -15,7 +15,6 @@ from django.core.exceptions import PermissionDenied from django.db.models import Q from django.http import HttpResponseRedirect from django.shortcuts import get_object_or_404 -from django.utils.decorators import available_attrs from django.utils.http import urlquote import debug # pyflakes:ignore @@ -113,7 +112,7 @@ def passes_test_decorator(test_func, message): error. The test function should be on the form fn(user) -> true/false.""" def decorate(view_func): - @wraps(view_func, assigned=available_attrs(view_func)) + @wraps(view_func, assigned=WRAPPER_ASSIGNMENTS) def inner(request, *args, **kwargs): if not request.user.is_authenticated: return HttpResponseRedirect('%s?%s=%s' % (settings.LOGIN_URL, REDIRECT_FIELD_NAME, urlquote(request.get_full_path())))