Feat/education api (#17168)

This commit is contained in:
Xiyuan Chen 2025-04-01 02:45:34 -04:00 committed by GitHub
commit 9c4be5d098
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 162 additions and 2 deletions

View file

@ -54,6 +54,17 @@ def only_edition_self_hosted(view):
return decorated
def cloud_edition_billing_enabled(view):
@wraps(view)
def decorated(*args, **kwargs):
features = FeatureService.get_features(current_user.current_tenant_id)
if not features.billing.enabled:
abort(403, "Billing feature is not enabled.")
return view(*args, **kwargs)
return decorated
def cloud_edition_billing_resource_check(resource: str):
def interceptor(view):
@wraps(view)