Merge the plans and mark many as deprecated. Fix a bunch of pylint errors.
This commit is contained in:
parent
2d0a61b6c2
commit
5633c1fc79
3 changed files with 119 additions and 81 deletions
|
@ -1,20 +1,13 @@
|
|||
import json
|
||||
import itertools
|
||||
|
||||
USER_PLANS = [
|
||||
{
|
||||
'title': 'Open Source',
|
||||
'price': 0,
|
||||
'privateRepos': 0,
|
||||
'stripeId': 'free',
|
||||
'audience': 'Share with the world',
|
||||
},
|
||||
PLANS = [
|
||||
# Deprecated Plans
|
||||
{
|
||||
'title': 'Micro',
|
||||
'price': 700,
|
||||
'privateRepos': 5,
|
||||
'stripeId': 'micro',
|
||||
'audience': 'For smaller teams',
|
||||
'bus_features': False,
|
||||
'deprecated': True,
|
||||
},
|
||||
{
|
||||
'title': 'Basic',
|
||||
|
@ -22,6 +15,8 @@ USER_PLANS = [
|
|||
'privateRepos': 10,
|
||||
'stripeId': 'small',
|
||||
'audience': 'For your basic team',
|
||||
'bus_features': False,
|
||||
'deprecated': True,
|
||||
},
|
||||
{
|
||||
'title': 'Medium',
|
||||
|
@ -29,6 +24,8 @@ USER_PLANS = [
|
|||
'privateRepos': 20,
|
||||
'stripeId': 'medium',
|
||||
'audience': 'For medium teams',
|
||||
'bus_features': False,
|
||||
'deprecated': True,
|
||||
},
|
||||
{
|
||||
'title': 'Large',
|
||||
|
@ -36,16 +33,28 @@ USER_PLANS = [
|
|||
'privateRepos': 50,
|
||||
'stripeId': 'large',
|
||||
'audience': 'For larger teams',
|
||||
'bus_features': False,
|
||||
'deprecated': True,
|
||||
},
|
||||
]
|
||||
|
||||
BUSINESS_PLANS = [
|
||||
# Active plans
|
||||
{
|
||||
'title': 'Open Source',
|
||||
'price': 0,
|
||||
'privateRepos': 0,
|
||||
'stripeId': 'bus-free',
|
||||
'stripeId': 'free',
|
||||
'audience': 'Committment to FOSS',
|
||||
'bus_features': False,
|
||||
'deprecated': False,
|
||||
},
|
||||
{
|
||||
'title': 'Personal',
|
||||
'price': 1200,
|
||||
'privateRepos': 5,
|
||||
'stripeId': 'personal',
|
||||
'audience': 'Individuals',
|
||||
'bus_features': False,
|
||||
'deprecated': False,
|
||||
},
|
||||
{
|
||||
'title': 'Skiff',
|
||||
|
@ -53,6 +62,8 @@ BUSINESS_PLANS = [
|
|||
'privateRepos': 10,
|
||||
'stripeId': 'bus-micro',
|
||||
'audience': 'For startups',
|
||||
'bus_features': True,
|
||||
'deprecated': False,
|
||||
},
|
||||
{
|
||||
'title': 'Yacht',
|
||||
|
@ -60,6 +71,8 @@ BUSINESS_PLANS = [
|
|||
'privateRepos': 20,
|
||||
'stripeId': 'bus-small',
|
||||
'audience': 'For small businesses',
|
||||
'bus_features': True,
|
||||
'deprecated': False,
|
||||
},
|
||||
{
|
||||
'title': 'Freighter',
|
||||
|
@ -67,6 +80,8 @@ BUSINESS_PLANS = [
|
|||
'privateRepos': 50,
|
||||
'stripeId': 'bus-medium',
|
||||
'audience': 'For normal businesses',
|
||||
'bus_features': True,
|
||||
'deprecated': False,
|
||||
},
|
||||
{
|
||||
'title': 'Tanker',
|
||||
|
@ -74,14 +89,16 @@ BUSINESS_PLANS = [
|
|||
'privateRepos': 125,
|
||||
'stripeId': 'bus-large',
|
||||
'audience': 'For large businesses',
|
||||
'bus_features': True,
|
||||
'deprecated': False,
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
def get_plan(id):
|
||||
def get_plan(plan_id):
|
||||
""" Returns the plan with the given ID or None if none. """
|
||||
for plan in itertools.chain(USER_PLANS, BUSINESS_PLANS):
|
||||
if plan['stripeId'] == id:
|
||||
for plan in PLANS:
|
||||
if plan['stripeId'] == plan_id:
|
||||
return plan
|
||||
|
||||
return None
|
||||
|
|
Reference in a new issue