From 5f3bfd1ae458a5883d550ab3a462c16cfa1116dd Mon Sep 17 00:00:00 2001 From: Matt Tuchfarber Date: Thu, 21 Mar 2019 11:16:01 -0400 Subject: [PATCH] Fix documentation and logging --- openedx/core/djangoapps/user_api/accounts/permissions.py | 3 +-- openedx/core/djangoapps/user_api/accounts/views.py | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) 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