Mbonea commited on
Commit
dddd522
·
1 Parent(s): 7c57d50

terminating early

Browse files
Files changed (1) hide show
  1. App/Messages/MessagesRoute.py +6 -2
App/Messages/MessagesRoute.py CHANGED
@@ -95,8 +95,12 @@ async def receive_message(message_data: MessageCreate):
95
  )
96
 
97
  # Ensure 'create_payment' is an async function
98
- payment: Payment = await create_payment(payment_details, internal=True)
99
- await payment.create_subscription_or_balance()
 
 
 
 
100
 
101
  # Create a new message record with parsed_data
102
  message = await Message.create(
 
95
  )
96
 
97
  # Ensure 'create_payment' is an async function
98
+ payment = await create_payment(payment_details, internal=True)
99
+
100
+ if isinstance(payment, Payment):
101
+ await payment.create_subscription_or_balance()
102
+ else:
103
+ return payment
104
 
105
  # Create a new message record with parsed_data
106
  message = await Message.create(