mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-12-18 18:47:11 +00:00
Get Khoj Cloud Subscription URL via environment variable
This commit is contained in:
parent
609d358b1a
commit
c52affc6d9
3 changed files with 2 additions and 2 deletions
|
@ -178,7 +178,7 @@
|
||||||
</div>
|
</div>
|
||||||
{% if not is_subscribed %}
|
{% if not is_subscribed %}
|
||||||
<div class="card-action-row">
|
<div class="card-action-row">
|
||||||
<a class="card-button happy" href="https://buy.stripe.com/28ocQb7kb4iD0cEdQQ?email={{ username }}" target="_blank">
|
<a class="card-button happy" href="{{ khoj_cloud_subscription_url }}?email={{ username }}" target="_blank">
|
||||||
Subscribe
|
Subscribe
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12h14M12 5l7 7-7 7"></path></svg>
|
<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12h14M12 5l7 7-7 7"></path></svg>
|
||||||
</a>
|
</a>
|
||||||
|
|
|
@ -782,7 +782,6 @@ async def unsubscribe(request: Request, email: str):
|
||||||
customer_id = customer[0].id
|
customer_id = customer[0].id
|
||||||
for subscription in stripe.Subscription.list(customer=customer_id):
|
for subscription in stripe.Subscription.list(customer=customer_id):
|
||||||
stripe.Subscription.modify(subscription.id, cancel_at_period_end=True)
|
stripe.Subscription.modify(subscription.id, cancel_at_period_end=True)
|
||||||
|
|
||||||
success = True
|
success = True
|
||||||
else:
|
else:
|
||||||
success = False
|
success = False
|
||||||
|
|
|
@ -149,6 +149,7 @@ def config_page(request: Request):
|
||||||
"user_photo": user_picture,
|
"user_photo": user_picture,
|
||||||
"is_subscribed": user_is_subscribed,
|
"is_subscribed": user_is_subscribed,
|
||||||
"days_to_renewal": days_to_renewal,
|
"days_to_renewal": days_to_renewal,
|
||||||
|
"khoj_cloud_subscription_url": os.getenv("KHOJ_CLOUD_SUBSCRIPTION_URL"),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue