This commit is contained in:
@@ -93,6 +93,11 @@ class ActivityViewSet(viewsets.ReadOnlyModelViewSet):
|
||||
contact_phone = signup_info.get('phone') or user.phone_number or ''
|
||||
if contact_name: order.customer_name = contact_name
|
||||
if contact_phone: order.phone_number = contact_phone
|
||||
|
||||
# Ensure activity is linked
|
||||
if not order.activity:
|
||||
order.activity = activity
|
||||
|
||||
order.save()
|
||||
|
||||
if not order:
|
||||
@@ -105,6 +110,9 @@ class ActivityViewSet(viewsets.ReadOnlyModelViewSet):
|
||||
|
||||
if pending_order:
|
||||
order = pending_order
|
||||
# Ensure shipping address is up-to-date
|
||||
order.shipping_address = activity.location or '线下活动'
|
||||
order.save()
|
||||
else:
|
||||
contact_name = signup_info.get('name') or signup_info.get('participant_name') or user.nickname or 'Activity User'
|
||||
contact_phone = signup_info.get('phone') or user.phone_number or ''
|
||||
@@ -136,7 +144,8 @@ class ActivityViewSet(viewsets.ReadOnlyModelViewSet):
|
||||
'total': int(activity.price * 100),
|
||||
'currency': 'CNY'
|
||||
},
|
||||
notify_url=wxpay._notify_url
|
||||
notify_url=wxpay._notify_url,
|
||||
attach=f'{{"type":"activity","activity_id":{activity.id}}}'
|
||||
)
|
||||
|
||||
import json
|
||||
|
||||
Reference in New Issue
Block a user