mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-12 02:58:59 +08:00
fix: get billing info in self-hosted edition from current workspace (#1774)
This commit is contained in:
parent
7775f5785f
commit
1a5279a3ef
@ -1,3 +1,4 @@
|
||||
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,10 +32,12 @@ class WorkspaceService:
|
||||
).first()
|
||||
tenant_info['role'] = tenant_account_join.role
|
||||
|
||||
billing_info = BillingService.get_info(tenant_info['id'])
|
||||
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]):
|
||||
tenant_info['custom_config'] = tenant.custom_config_dict
|
||||
if billing_info['can_replace_logo'] and TenantService.has_roles(tenant, [TenantAccountJoinRole.OWNER, TenantAccountJoinRole.ADMIN]):
|
||||
tenant_info['custom_config'] = tenant.custom_config_dict
|
||||
|
||||
# Get providers
|
||||
providers = db.session.query(Provider).filter(
|
||||
|
Loading…
x
Reference in New Issue
Block a user