mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-09-18 21:50:56 +00:00
Adding grace period to stripe customer check.
This commit is contained in:
parent
38763fa2c9
commit
baa3463213
1 changed files with 2 additions and 1 deletions
|
@ -342,9 +342,10 @@ def stripe_form(request):
|
|||
user.email = zebra_form.cleaned_data['email']
|
||||
user.save()
|
||||
|
||||
grace_period = datetime.datetime.now() - datetime.timedelta(days=30)
|
||||
current_premium = (user.profile.is_premium and
|
||||
user.profile.premium_expire and
|
||||
user.profile.premium_expire > datetime.datetime.now())
|
||||
user.profile.premium_expire > grace_period)
|
||||
# Are they changing their existing card?
|
||||
if user.profile.stripe_id and current_premium:
|
||||
customer = stripe.Customer.retrieve(user.profile.stripe_id)
|
||||
|
|
Loading…
Add table
Reference in a new issue