|
|
|
@ -573,14 +573,12 @@ class AuthenticationViewSet(viewsets.ViewSet):
|
|
|
|
|
@action_decorator(detail=False, methods=['POST'])
|
|
|
|
|
def signup(self, request):
|
|
|
|
|
serializer = AuthenticationSignupSerializer(data=request.data)
|
|
|
|
|
if serializer.is_valid():
|
|
|
|
|
serializer.is_valid(raise_exception=True)
|
|
|
|
|
user = serializer.save()
|
|
|
|
|
|
|
|
|
|
data = self.login_response_data(user)
|
|
|
|
|
return Response(data, status=status.HTTP_201_CREATED)
|
|
|
|
|
|
|
|
|
|
return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
|
|
|
|
|
|
|
|
|
|
def get_login_user(self, serializer):
|
|
|
|
|
username = serializer.validated_data.get('username')
|
|
|
|
|
email = serializer.validated_data.get('email')
|
|
|
|
|