Skip to content

Commit

Permalink
added specific response messages for username and email in lines 275-280
Browse files Browse the repository at this point in the history
  • Loading branch information
mtoof committed Aug 20, 2024
1 parent d1ad5c1 commit 6ac3e01
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Backend/user_service/user_service/user_app/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,12 @@ def available_username_email(self, request) -> Response:
response_message = {"error": "email is not available"}
status_code = status.HTTP_400_BAD_REQUEST
else:
response_message = {"detail": "username and email are available"}
if email is not None and username is not None:
response_message = {"detail": "username and email are available"}
elif username is not None:
response_message = {"detail": "username is available"}
elif email is not None:
response_message = {"detail": "email is available"}
else:
response_message = {'error':"username and email fields are required"}
status_code = status.HTTP_400_BAD_REQUEST
Expand Down

0 comments on commit 6ac3e01

Please sign in to comment.