from django.contrib.auth.models import User
from rest_framework import viewsets, mixins
from rest_framework.permissions import AllowAny
from rest_framework.response import Response

from auth_.serializers import UserRegistrationSerializer


class UserRegistrationViewSet(mixins.CreateModelMixin, viewsets.GenericViewSet):
    serializer_class = UserRegistrationSerializer
    queryset = User.objects.all()
    permission_classes = (AllowAny, )

    def create(self, request, *args, **kwargs):
        serializer = self.get_serializer(data=request.data)
        serializer.is_valid(raise_exception=True)
        user = serializer.save()

        if user:
            return Response({
                'user': UserRegistrationSerializer(user).data
            })
        return Response

bb9162e933c5439b1f17c7360e634b6bf4ba404a
<mask token>


class UserRegistrationViewSet(mixins.CreateModelMixin, viewsets.GenericViewSet
    ):
    <mask token>
    <mask token>
    <mask token>
    <mask token>

<mask token>


class UserRegistrationViewSet(mixins.CreateModelMixin, viewsets.GenericViewSet
    ):
    <mask token>
    <mask token>
    <mask token>

    def create(self, request, *args, **kwargs):
        serializer = self.get_serializer(data=request.data)
        serializer.is_valid(raise_exception=True)
        user = serializer.save()
        if user:
            return Response({'user': UserRegistrationSerializer(user).data})
        return Response

<mask token>


class UserRegistrationViewSet(mixins.CreateModelMixin, viewsets.GenericViewSet
    ):
    serializer_class = UserRegistrationSerializer
    queryset = User.objects.all()
    permission_classes = AllowAny,

    def create(self, request, *args, **kwargs):
        serializer = self.get_serializer(data=request.data)
        serializer.is_valid(raise_exception=True)
        user = serializer.save()
        if user:
            return Response({'user': UserRegistrationSerializer(user).data})
        return Response

from django.contrib.auth.models import User
from rest_framework import viewsets, mixins
from rest_framework.permissions import AllowAny
from rest_framework.response import Response
from auth_.serializers import UserRegistrationSerializer


class UserRegistrationViewSet(mixins.CreateModelMixin, viewsets.GenericViewSet
    ):
    serializer_class = UserRegistrationSerializer
    queryset = User.objects.all()
    permission_classes = AllowAny,

    def create(self, request, *args, **kwargs):
        serializer = self.get_serializer(data=request.data)
        serializer.is_valid(raise_exception=True)
        user = serializer.save()
        if user:
            return Response({'user': UserRegistrationSerializer(user).data})
        return Response

from django.contrib.auth.models import User
from rest_framework import viewsets, mixins
from rest_framework.permissions import AllowAny
from rest_framework.response import Response

from auth_.serializers import UserRegistrationSerializer


class UserRegistrationViewSet(mixins.CreateModelMixin, viewsets.GenericViewSet):
    serializer_class = UserRegistrationSerializer
    queryset = User.objects.all()
    permission_classes = (AllowAny, )

    def create(self, request, *args, **kwargs):
        serializer = self.get_serializer(data=request.data)
        serializer.is_valid(raise_exception=True)
        user = serializer.save()

        if user:
            return Response({
                'user': UserRegistrationSerializer(user).data
            })
        return Response
