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

quality

parent 7458cd88
No related merge requests found
......@@ -627,7 +627,7 @@ class ReplaceUsernameView(APIView):
if exc.status_code == 404:
return Response(status=status.HTTP_404_NOT_FOUND)
raise
except Exception as exc: # pylint disable-broad-except
except Exception as exc: # pylint: disable=broad-except
return Response(text_type(exc), status=status.HTTP_500_INTERNAL_SERVER_ERROR)
return Response(status=status.HTTP_204_NO_CONTENT)
......
......@@ -1145,21 +1145,25 @@ class UsernameReplacementView(APIView):
**{column: new_username}
)
except Exception as exc: # pylint: disable-broad-except
log.exception("Unable to change username from {current} to {new}. Reason: {error}".format(
current=current_username,
new=new_username,
error=exc
))
log.exception(
"Unable to change username from %s to %s. Reason: %s",
current_username,
new_username,
exc
)
return False
if num_rows_changed == 0:
log.warning("Unable to change username from {current} to {new} because {current} doesn't exist.".format(
current=current_username,
new=new_username,
))
log.warning(
"Unable to change username from %s to %s because %s doesn't exist.",
current_username,
new_username,
current_username,
)
return False
log.info("Successfully changed username from {current} to {new}.".format(
current=current_username,
new=new_username,
))
log.info(
"Successfully changed username from %s to %s.",
current_username,
new_username,
)
return True
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