|
|
|
@@ -1,3 +1,5 @@ |
|
|
|
|
|
|
|
from flask import current_app |
|
|
|
from flask_login import current_user |
|
|
|
|
|
|
|
from extensions.ext_database import db |
|
|
|
@@ -31,7 +33,15 @@ class WorkspaceService: |
|
|
|
|
|
|
|
can_replace_logo = FeatureService.get_features(tenant_info['id']).can_replace_logo |
|
|
|
|
|
|
|
if can_replace_logo and TenantService.has_roles(tenant, [TenantAccountJoinRole.OWNER, TenantAccountJoinRole.ADMIN]): |
|
|
|
tenant_info['custom_config'] = tenant.custom_config_dict |
|
|
|
if can_replace_logo and TenantService.has_roles(tenant, |
|
|
|
[TenantAccountJoinRole.OWNER, TenantAccountJoinRole.ADMIN]): |
|
|
|
base_url = current_app.config.get('FILES_URL') |
|
|
|
replace_webapp_logo = f'{base_url}/files/workspaces/{tenant.id}/webapp-logo' if tenant.custom_config_dict.get('replace_webapp_logo') else None |
|
|
|
remove_webapp_brand = tenant.custom_config_dict.get('remove_webapp_brand', False) |
|
|
|
|
|
|
|
tenant_info['custom_config'] = { |
|
|
|
'remove_webapp_brand': remove_webapp_brand, |
|
|
|
'replace_webapp_logo': replace_webapp_logo, |
|
|
|
} |
|
|
|
|
|
|
|
return tenant_info |