From 780e908bbbbfca01a608ddbf33e0e3f34b3227d7 Mon Sep 17 00:00:00 2001 From: "Lewis M. Kabui" <13940255+lewisemm@users.noreply.github.com> Date: Tue, 16 Jan 2024 12:27:06 +0300 Subject: [PATCH] fix: Replace deprecated .warn method with .warning (#34057) The `logging.Logger.warn` method has been deprecated since Python 3.3 and is due to be removed all together in Python 3.13. See https://github.com/python/cpython/pull/105377 `logging.Logger.warning` is the preferred and recommended way to log warnings. Fixes https://github.com/openedx/public-engineering/issues/149 Co-authored-by: Lewis M. Kabui --- openedx/core/djangoapps/user_authn/views/login.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openedx/core/djangoapps/user_authn/views/login.py b/openedx/core/djangoapps/user_authn/views/login.py index 4880e58a433c..cbadf2e74182 100644 --- a/openedx/core/djangoapps/user_authn/views/login.py +++ b/openedx/core/djangoapps/user_authn/views/login.py @@ -402,7 +402,7 @@ def _check_user_auth_flow(site, user): # we don't record their e-mail in case there is sensitive info accidentally # in there. set_custom_attribute('login_tpa_domain_shortcircuit_user_id', user.id) - log.warn("User %s has nonstandard e-mail. Shortcircuiting THIRD_PART_AUTH_ONLY_DOMAIN check.", user.id) # lint-amnesty, pylint: disable=deprecated-method + log.warning("User %s has nonstandard e-mail. Shortcircuiting THIRD_PART_AUTH_ONLY_DOMAIN check.", user.id) return user_domain = email_parts[1].strip().lower()