From efa979a13d92885e3e66668d23551cfbed5468ca Mon Sep 17 00:00:00 2001 From: John Nagro Date: Wed, 6 Jul 2022 13:05:14 -0400 Subject: [PATCH] temp: guard against resume button failures in dropdown template (#30703) --- openedx/core/djangoapps/user_api/accounts/utils.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/openedx/core/djangoapps/user_api/accounts/utils.py b/openedx/core/djangoapps/user_api/accounts/utils.py index fd80ed82b8..2b348b4e13 100644 --- a/openedx/core/djangoapps/user_api/accounts/utils.py +++ b/openedx/core/djangoapps/user_api/accounts/utils.py @@ -2,6 +2,7 @@ Utility methods for the account settings. """ +import logging import random import re import string @@ -19,11 +20,11 @@ from openedx.core.djangolib.oauth2_retirement_utils import retire_dot_oauth2_mod from openedx.core.djangoapps.site_configuration.models import SiteConfiguration from openedx.core.djangoapps.theming.helpers import get_config_value_from_site_or_settings, get_current_site from xmodule.modulestore.django import modulestore # lint-amnesty, pylint: disable=wrong-import-order -from xmodule.modulestore.exceptions import ItemNotFoundError # lint-amnesty, pylint: disable=wrong-import-order from ..models import UserRetirementStatus ENABLE_SECONDARY_EMAIL_FEATURE_SWITCH = 'enable_secondary_email_feature' +LOGGER = logging.getLogger(__name__) def validate_social_link(platform_name, new_social_link): @@ -170,7 +171,11 @@ def retrieve_last_sitewide_block_completed(user): try: item = modulestore().get_item(candidate_block_key, depth=1) - except ItemNotFoundError: + except Exception as err: # pylint: disable=broad-except + LOGGER.exception( + '[PROD-2877] Error retrieving resume block for user %s with raw error %r', + user.username, err, + ) item = None if not (lms_root and item):