Ejemplo n.º 1
0
 def post(self, request, format=None):
     serializer = RegisterSerializer(data=request.data)
     if serializer.is_valid(raise_exception=True):
         user = serializer.save()
         send_activation_mail(user)
         return Response("User successfully registered",
                         status=status.HTTP_201_CREATED)
Ejemplo n.º 2
0
 def create(self, validated_data):
     email = validated_data.get('email')
     password = validated_data.get('password')
     user = User.objects.create_user(email=email, password=password)
     send_activation_mail(email=user.email,
                          activation_code=user.activation_code)
     return user
Ejemplo n.º 3
0
 def get(self, request):
     email = request.query_params.get('email')
     user = get_object_or_404(User, email=email)
     user.is_active = False
     user.create_activation_code_()
     user.save()
     send_activation_mail(user.email, user.activation_code)
     return Response('Вам отправлено письмо', status=200)
Ejemplo n.º 4
0
 def create(self, validated_data):
     user = MyUser.objects.create_user(**validated_data)
     send_activation_mail(user.email, user.activation_code)
     if user.status == 'master':
         ProfileMaster.objects.create(user=user, email=user.email)
     else:
         ProfileCustomer.objects.create(user=user, email=user.email)
     return user
Ejemplo n.º 5
0
 def save(self, commit=True):
     user = User.objects.create(**self.cleaned_data)
     send_activation_mail(user)
     return user
Ejemplo n.º 6
0
 def save(self):
     user = User.objects.create(**self.cleaned_data)
     user.create_activation_code()
     send_activation_mail(user.email, user.activation_code)
     # pass_ = 'oaeaebcegktfspze'
     return user
Ejemplo n.º 7
0
    def save(self):
        user = User.objects.create(**self.cleaned_data)
        user.create_activation_code()
        send_activation_mail(user.email, user.activation_code)

        return user