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