Fix documentation and logging

This commit is contained in:
Matt Tuchfarber
2019-03-21 11:16:01 -04:00
parent 41a5ebb0a1
commit 5f3bfd1ae4
2 changed files with 3 additions and 3 deletions

View File

@@ -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)

View File

@@ -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