Unverified Commit 1a5279a3 authored by zxhlyh's avatar zxhlyh Committed by GitHub

fix: get billing info in self-hosted edition from current workspace (#1774)

parent 7775f578
from flask import current_app
from flask_login import current_user
from extensions.ext_database import db
from models.account import Tenant, TenantAccountJoin, TenantAccountJoinRole
......@@ -31,6 +32,8 @@ class WorkspaceService:
).first()
tenant_info['role'] = tenant_account_join.role
edition = current_app.config['EDITION']
if edition == 'CLOUD':
billing_info = BillingService.get_info(tenant_info['id'])
if billing_info['can_replace_logo'] and TenantService.has_roles(tenant, [TenantAccountJoinRole.OWNER, TenantAccountJoinRole.ADMIN]):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment