Skip to content

Commit

Permalink
feat: error message changed
Browse files Browse the repository at this point in the history
  • Loading branch information
rb-25 committed May 29, 2024
1 parent 1310fb3 commit 91fb80f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@ venv/*
db.sqlite3
__pycache__/
.env
ai_views.py
.github
.hooks
5 changes: 4 additions & 1 deletion gibspons/users/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ class RegisterView(APIView):
permission_classes = [AllowAny]
def post(self, request):
serializer=UserSerializer(data=request.data)
serializer.is_valid(raise_exception=True)
try:
serializer.is_valid()
except:
return Response({"detail":serializer.errors},status=status.HTTP_400_BAD_REQUEST)
serializer.save()
return Response(serializer.data)
def get(self,request):
Expand Down

0 comments on commit 91fb80f

Please sign in to comment.