Tiered LDAP groups
This commit is contained in:
@@ -141,3 +141,13 @@ for key, tier in MEMBERSHIP_TIERS.items():
|
||||
raise ValueError
|
||||
except (InvalidOperation, ValueError, TypeError):
|
||||
raise ImproperlyConfigured(f"Tier {key} usd_amount must be a positive USD amount with at most two decimals.") from None
|
||||
|
||||
# Separate from Stripe tiers so free accounts can receive service benefits too.
|
||||
from members.service_groups import validate_service_groups
|
||||
|
||||
service_groups_file = os.environ.get("MEMBERSHIP_SERVICE_GROUPS_FILE", "")
|
||||
try:
|
||||
service_groups = json.loads(os.environ["MEMBERSHIP_SERVICE_GROUPS_JSON"]) if "MEMBERSHIP_SERVICE_GROUPS_JSON" in os.environ else json.loads(Path(service_groups_file).read_text(encoding="utf-8")) if service_groups_file else {}
|
||||
except (ValueError, OSError):
|
||||
raise ImproperlyConfigured("Cannot load membership service group configuration.") from None
|
||||
MEMBERSHIP_SERVICE_GROUPS = validate_service_groups(service_groups, levels)
|
||||
|
||||
Reference in New Issue
Block a user