Merge branch 'restructure' of https://bitbucket.org/yackob03/quay into restructure

This commit is contained in:
Joseph Schorr 2013-12-23 15:05:11 -05:00
commit 55c0c12d04

View file

@ -1537,11 +1537,15 @@ def subscribe(user, plan, token, require_business_plan):
if plan_obj['stripeId'] == plan:
plan_found = plan_obj
if not plan_found:
if not plan_found or plan_found['deprecated']:
logger.warning('Plan not found or deprecated: %s', plan)
abort(404)
if require_business_plan and not plan_found['bus_features'] and not plan_found['price'] == 0:
abort(404)
if (require_business_plan and not plan_found['bus_features'] and not
plan_found['price'] == 0):
logger.warning('Business attempting to subscribe to personal plan: %s',
user.username)
abort(400)
private_repos = model.get_private_repo_count(user.username)