Stripe checkout #104411
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user