Fix documentation and logging
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user