Skip to content

Commit

Permalink
Merge branch 'master' into 7279-materials
Browse files Browse the repository at this point in the history
  • Loading branch information
moellep authored Jan 22, 2025
2 parents b006eea + 2898e25 commit d33c904
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 12 deletions.
9 changes: 2 additions & 7 deletions sirepo/auth/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,9 @@
_GUEST_USER_DISPLAY_NAME = "Guest User"

_PAYMENT_PLAN_BASIC = "basic"
_PAYMENT_PLAN_ENTERPRISE = sirepo.auth_role.ROLE_PAYMENT_PLAN_ENTERPRISE
_PAYMENT_PLAN_PREMIUM = sirepo.auth_role.ROLE_PAYMENT_PLAN_PREMIUM
_ALL_PAYMENT_PLANS = (
_PAYMENT_PLAN_BASIC,
_PAYMENT_PLAN_ENTERPRISE,
_PAYMENT_PLAN_PREMIUM,
)

Expand Down Expand Up @@ -765,12 +763,9 @@ def _method_user_model(self, module, uid):

def _plan(self, data):
r = data.roles
if sirepo.auth_role.ROLE_PAYMENT_PLAN_ENTERPRISE in r:
data.paymentPlan = _PAYMENT_PLAN_ENTERPRISE
data.upgradeToPlan = None
elif sirepo.auth_role.ROLE_PAYMENT_PLAN_PREMIUM in r:
if sirepo.auth_role.ROLE_PAYMENT_PLAN_PREMIUM in r:
data.paymentPlan = _PAYMENT_PLAN_PREMIUM
data.upgradeToPlan = _PAYMENT_PLAN_ENTERPRISE
data.upgradeToPlan = None
else:
data.paymentPlan = _PAYMENT_PLAN_BASIC
data.upgradeToPlan = _PAYMENT_PLAN_PREMIUM
Expand Down
4 changes: 1 addition & 3 deletions sirepo/auth_role.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@

ROLE_ADM = "adm"
ROLE_USER = "user"
ROLE_PAYMENT_PLAN_ENTERPRISE = "enterprise"
ROLE_PAYMENT_PLAN_PREMIUM = "premium"
PAID_USER_ROLES = (ROLE_PAYMENT_PLAN_PREMIUM, ROLE_PAYMENT_PLAN_ENTERPRISE)
PAID_USER_ROLES = (ROLE_PAYMENT_PLAN_PREMIUM,)
_SIM_TYPE_ROLE_PREFIX = "sim_type_"


Expand Down Expand Up @@ -59,7 +58,6 @@ def get_all():
for_sim_type(t) for t in sirepo.feature_config.auth_controlled_sim_types()
] + [
ROLE_ADM,
ROLE_PAYMENT_PLAN_ENTERPRISE,
ROLE_PAYMENT_PLAN_PREMIUM,
ROLE_USER,
]
Expand Down
2 changes: 1 addition & 1 deletion sirepo/package_data/static/js/sirepo.js
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ SIREPO.app.factory('authState', function(appDataService, appState, errorService,

self.isPremiumUser = function() {
// positive test (vs just testing 'basic')
return ['enterprise', 'premium'].indexOf(self.paymentPlan || '') >= 0;
return self.paymentPlan == 'premium';
};

self.paymentPlanName = function() {
Expand Down
1 change: 0 additions & 1 deletion sirepo/package_data/static/json/schema-common.json
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,6 @@
"oneDayMillis": 86400000,
"paymentPlans": {
"basic": "Sirepo Community",
"enterprise": "Sirepo Enterprise",
"premium": "Sirepo Professional"
},
"plansUrl": "/plans",
Expand Down

0 comments on commit d33c904

Please sign in to comment.