mirror of
https://github.com/QuivrHQ/quivr.git
synced 2024-09-11 14:36:35 +03:00
fix: Add logic to filter active subscriptions in check_if_is_premium_user function (#2673)
# Description Please include a summary of the changes and the related issue. Please also include relevant motivation and context. ## Checklist before requesting a review Please delete options that are not relevant. - [ ] My code follows the style guidelines of this project - [ ] I have performed a self-review of my code - [ ] I have commented hard-to-understand areas - [ ] I have ideally added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] Any dependent changes have been merged ## Screenshots (if appropriate): Co-authored-by: Stan Girard <stan@quivr.app>
This commit is contained in:
parent
7b3d5d81dd
commit
f546fd4d54
@ -199,6 +199,16 @@ def check_if_is_premium_user():
|
|||||||
)
|
)
|
||||||
.execute()
|
.execute()
|
||||||
).data
|
).data
|
||||||
|
# Only get the subscriptions with status active
|
||||||
|
logger.info(f"Subscriptions: {subscriptions}")
|
||||||
|
if len(subscriptions) > 0:
|
||||||
|
subscriptions = [
|
||||||
|
subscription
|
||||||
|
for subscription in subscriptions
|
||||||
|
if subscription["attrs"]["status"] == "active"
|
||||||
|
]
|
||||||
|
else:
|
||||||
|
logger.info(f"No active subscriptions found")
|
||||||
|
|
||||||
# Get List of all customers
|
# Get List of all customers
|
||||||
customers = (
|
customers = (
|
||||||
|
Loading…
Reference in New Issue
Block a user