This commit is contained in:
Joseph Schorr 2014-04-27 16:35:58 -04:00
commit 160ccc0d96
2 changed files with 4 additions and 2 deletions

View file

@ -133,6 +133,8 @@ class FakeStripe(object):
'plan': FAKE_PLAN,
'current_period_start': timegm(datetime.now().utctimetuple()),
'current_period_end': timegm((datetime.now() + timedelta(days=30)).utctimetuple()),
'trial_start': timegm(datetime.now().utctimetuple()),
'trial_end': timegm((datetime.now() + timedelta(days=30)).utctimetuple()),
})
FAKE_CARD = AttrDict({

View file

@ -1,13 +1,13 @@
from data import model
from data.database import User
from app import stripe
from app import billing as stripe
from data.plans import get_plan
def get_private_allowed(customer):
if not customer.stripe_id:
return 0
subscription = stripe.Customer.retrieve(customer.stripe_id).subscription
subscription = stripe.Customer.retrieve(customer.stripe_id).get('subscription', None)
if subscription is None:
return 0