From c356c754945e8d884e6d3f605e0e95e2daa9f8f8 Mon Sep 17 00:00:00 2001 From: Son Date: Fri, 26 Nov 2021 18:20:39 +0100 Subject: [PATCH] show coupon expires date when user buys a coupon --- app/dashboard/views/coupon.py | 3 +++ templates/dashboard/coupon.html | 3 +++ 2 files changed, 6 insertions(+) diff --git a/app/dashboard/views/coupon.py b/app/dashboard/views/coupon.py index cab9145f..8f5a9ef2 100644 --- a/app/dashboard/views/coupon.py +++ b/app/dashboard/views/coupon.py @@ -121,4 +121,7 @@ def coupon_route(): PADDLE_VENDOR_ID=PADDLE_VENDOR_ID, PADDLE_COUPON_ID=PADDLE_COUPON_ID, can_use_coupon=can_use_coupon, + # a coupon is only valid until this date + # this is to avoid using the coupon to renew an account forever + max_coupon_date=arrow.now().shift(years=1, days=-1), ) diff --git a/templates/dashboard/coupon.html b/templates/dashboard/coupon.html index 7c011b29..6a7a4059 100644 --- a/templates/dashboard/coupon.html +++ b/templates/dashboard/coupon.html @@ -52,6 +52,9 @@ Can be an idea for a gift card :). After the payment, the coupon will be sent to you by email. +
+ The coupon must be used before {{ max_coupon_date.date().isoformat() }} +
Buy 1-year SimpleLogin coupon