Skip to content

Commit

Permalink
fix: Replace deprecated .warn method with .warning (#34057)
Browse files Browse the repository at this point in the history
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
python/cpython#105377

`logging.Logger.warning` is the preferred and recommended way to log
warnings.

Fixes openedx/public-engineering#149

Co-authored-by: Lewis M. Kabui <[email protected]>
  • Loading branch information
lewisemm and lewisemm authored Jan 16, 2024
1 parent 692b3ac commit 780e908
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion openedx/core/djangoapps/user_authn/views/login.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit 780e908

Please sign in to comment.