mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-23 23:48:56 +01:00
Call subscription_to_state with sync_to_async wrapper when getting user subscription state
- This is needed in case the renewal_date is not set and we need to reset it for the user
This commit is contained in:
parent
ec44cbe1e7
commit
075b4ecf15
1 changed files with 1 additions and 1 deletions
|
@ -333,7 +333,7 @@ async def aget_user_subscription_state(user: KhojUser) -> str:
|
|||
Valid state transitions: trial -> subscribed <-> unsubscribed OR expired
|
||||
"""
|
||||
user_subscription = await Subscription.objects.filter(user=user).afirst()
|
||||
return subscription_to_state(user_subscription)
|
||||
return await sync_to_async(subscription_to_state)(user_subscription)
|
||||
|
||||
|
||||
async def ais_user_subscribed(user: KhojUser) -> bool:
|
||||
|
|
Loading…
Reference in a new issue