Stripe checkout #104411

Merged
Anna Sirota merged 61 commits from stripe into main 2024-06-17 18:08:41 +02:00
Showing only changes of commit 416b16261f - Show all commits

View File

@ -93,12 +93,14 @@ class SubscriptionEmailPreviewAdmin(looper.admin.mixins.NoAddDeleteMixin, EmailA
def get_object(self, request, object_id, from_field=None):
"""Construct the Email on th fly from known subscription email templates."""
user = User()
user.customer = looper.models.Customer(full_name='Jane Doe')
user = User(full_name='Jane Doe')
customer = looper.models.Customer()
user.customer = customer
customer.user = user
now = timezone.now()
subscription = looper.models.Subscription(
id=1234567890,
user=user,
customer=user.customer,
payment_method=looper.models.PaymentMethod(
method_type='cc',
gateway_id=1,
@ -112,7 +114,7 @@ class SubscriptionEmailPreviewAdmin(looper.admin.mixins.NoAddDeleteMixin, EmailA
)
order = looper.models.Order(subscription=subscription)
context = {
'user': subscription.user,
'user': user,
'subscription': subscription,
'order': order,
# Also add context for the expired email