From 474ca32e14a04abc54b33fd03a3d3f786a1a6478 Mon Sep 17 00:00:00 2001 From: Hubert Jankowski Date: Sun, 12 Dec 2021 23:20:04 +0100 Subject: [PATCH] fix register --- users/views.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/users/views.py b/users/views.py index 1fb1104..0d42270 100644 --- a/users/views.py +++ b/users/views.py @@ -21,6 +21,13 @@ class RegisterViewSet(generics.GenericAPIView): def post(self, request): serializer = self.get_serializer(data=request.data) if serializer.is_valid(): + data = self.request.data + User.objects.create( + email=data["email"], + first_name=data["first_name"], + last_name=data["last_name"], + password=data["password"] + ) return Response({"detail": "Done"}, status=status.HTTP_200_OK) else: return Response(data=serializer.errors, status=status.HTTP_400_BAD_REQUEST)