mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-02 21:19:12 +00: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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user