Make Stripe configurable
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
import logging
|
||||
|
||||
import stripe
|
||||
from django.conf import settings
|
||||
from django.contrib.auth.models import AbstractUser
|
||||
from django.db import models
|
||||
from django.conf import settings
|
||||
|
||||
from core.lib.customers import get_or_create, update_customer_fields
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
@@ -37,7 +38,9 @@ class User(AbstractUser):
|
||||
"""
|
||||
if settings.STRIPE_ENABLED:
|
||||
if not self.stripe_id: # stripe ID not stored
|
||||
self.stripe_id = get_or_create(self.email, self.first_name, self.last_name)
|
||||
self.stripe_id = get_or_create(
|
||||
self.email, self.first_name, self.last_name
|
||||
)
|
||||
|
||||
to_update = {}
|
||||
if self.email != self._original.email:
|
||||
|
||||
Reference in New Issue
Block a user