diff --git a/openedx/core/djangoapps/user_api/accounts/permissions.py b/openedx/core/djangoapps/user_api/accounts/permissions.py index 9092ca002c..7b14ce00c6 100644 --- a/openedx/core/djangoapps/user_api/accounts/permissions.py +++ b/openedx/core/djangoapps/user_api/accounts/permissions.py @@ -28,8 +28,7 @@ class CanRetireUser(permissions.BasePermission): class CanReplaceUsername(permissions.BasePermission): """ - Grants access to the Username Replacement API for anyone in the group, - including the service user. + Grants access to the Username Replacement API for the service user. """ def has_permission(self, request, view): return request.user.username == getattr(settings, "USERNAME_REPLACEMENT_WORKER", False) diff --git a/openedx/core/djangoapps/user_api/accounts/views.py b/openedx/core/djangoapps/user_api/accounts/views.py index a5974c9584..4ee7fbaa2e 100644 --- a/openedx/core/djangoapps/user_api/accounts/views.py +++ b/openedx/core/djangoapps/user_api/accounts/views.py @@ -1148,9 +1148,10 @@ class UsernameReplacementView(APIView): ) except Exception as exc: # pylint: disable=broad-except log.exception( - u"Unable to change username from %s to %s. Reason: %s", + u"Unable to change username from %s to %s. Failed on table %s because %s", current_username, new_username, + model.__class__.__name__, # Retrieves the model name that it failed on exc ) return False