(
        self, actor: User, billing_email: str, length_days: int = 30
    )
Start the timer for the trial and create a Stripe customer.

        If the trial already exists, we only update the email if provided. We
        also update the Stripe customer email.
Start the timer for the trial and create a Stripe customer.
Start the timer for the trial and create a Stripe customer .
def start_trial(
        self, actor: User, billing_email: str, length_days: int = 30
    ) -> None:
        """
        Start the timer for the trial and create a Stripe customer.

        If the trial already exists, we only update the email if provided. We
        also update the Stripe customer email.
        """
        self.trial_email = billing_email
        if self.trial_expiration is None:
            self.trial_expiration = timezone.now() + datetime.timedelta(
                days=length_days
            )
            self.trial_start = timezone.now()
            self.trial_started_by = actor
        else:
            logger.warning("attempted to start trial when one already exists")
        if not self.stripe_customer_id:
            customer = stripe.Customer.create(email=billing_email)
            self.stripe_customer_id = customer.id
        else:
            stripe.Customer.modify(self.stripe_customer_id, email=billing_email)
        self.save()
        self.update_bot()
def start_trial ( self , actor : User , billing_email : str , length_days : int = 30 ) -> None : self . trial_email = billing_email if self . trial_expiration is None : self . trial_expiration = timezone . now ( ) + datetime . timedelta ( days = length_days ) self . trial_start = timezone . now ( ) self . trial_started_by = actor else : logger . warning ( "attempted to start trial when one already exists" ) if not self . stripe_customer_id : customer = stripe . Customer . create ( email = billing_email ) self . stripe_customer_id = customer . id else : stripe . Customer . modify ( self . stripe_customer_id , email = billing_email ) self . save ( ) self . update_bot ( )