Skip to content
Snippets Groups Projects
Commit 5f3bfd1a authored by Matt Tuchfarber's avatar Matt Tuchfarber
Browse files

Fix documentation and logging

parent 41a5ebb0
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment