def create(self, validated_data): email = validated_data.get('email') password = validated_data.get('password') user = MyUser.objects.create_user(email=email, password=password) send_activation_code(email=user.email, activation_code=user.activation_code) return user
def create(self, validated_data): """This function is called when self.save() method is called """ email = validated_data.get('email') password = validated_data.get('password') user = MyUser.objects.create_user(email=email, password=password) send_activation_code(email=user.email, activation_code=user.activation_code) return user
def create(self, validated_data): """ Это функция вызывается когда мы сохраняем объект через метод self.save() """ email = validated_data.get('email') password = validated_data.get('password') user = MyUser.objects.create_user(email=email, password=password) send_activation_code(email=user.email, activation_code=user.activation_code) return user