Update to run with Podman
This commit is contained in:
@@ -78,8 +78,9 @@ class User(AbstractUser):
|
||||
"""
|
||||
Override the save function to create a Stripe customer.
|
||||
"""
|
||||
if not self.stripe_id: # stripe ID not stored
|
||||
self.stripe_id = get_or_create(self.email, self.first_name, self.last_name)
|
||||
if settings.BILLING_ENABLED:
|
||||
if not self.stripe_id: # stripe ID not stored
|
||||
self.stripe_id = get_or_create(self.email, self.first_name, self.last_name)
|
||||
|
||||
to_update = {}
|
||||
if self.email != self._original.email:
|
||||
@@ -89,14 +90,16 @@ class User(AbstractUser):
|
||||
if self.last_name != self._original.last_name:
|
||||
to_update["last_name"] = self.last_name
|
||||
|
||||
update_customer_fields(self.stripe_id, **to_update)
|
||||
if settings.BILLING_ENABLED:
|
||||
update_customer_fields(self.stripe_id, **to_update)
|
||||
|
||||
super().save(*args, **kwargs)
|
||||
|
||||
def delete(self, *args, **kwargs):
|
||||
if self.stripe_id:
|
||||
stripe.Customer.delete(self.stripe_id)
|
||||
logger.info(f"Deleted Stripe customer {self.stripe_id}")
|
||||
if settings.BILLING_ENABLED:
|
||||
if self.stripe_id:
|
||||
stripe.Customer.delete(self.stripe_id)
|
||||
logger.info(f"Deleted Stripe customer {self.stripe_id}")
|
||||
super().delete(*args, **kwargs)
|
||||
|
||||
def has_plan(self, plan):
|
||||
|
||||
Reference in New Issue
Block a user