chore: use TenantAccountRole instead of TenantAccountJoinRole (#15514)

Co-authored-by: 刘江波 <jiangbo721@163.com>
This commit is contained in:
jiangbo721
2025-03-12 12:56:30 +08:00
committed by GitHub
parent 545e5cbcd6
commit 0415cc209d
4 changed files with 8 additions and 20 deletions

View File

@@ -2,7 +2,7 @@ from flask_login import current_user # type: ignore
from configs import dify_config
from extensions.ext_database import db
from models.account import Tenant, TenantAccountJoin, TenantAccountJoinRole
from models.account import Tenant, TenantAccountJoin, TenantAccountRole
from services.account_service import TenantService
from services.feature_service import FeatureService
@@ -33,9 +33,7 @@ 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]
):
if can_replace_logo and TenantService.has_roles(tenant, [TenantAccountRole.OWNER, TenantAccountRole.ADMIN]):
base_url = dify_config.FILES_URL
replace_webapp_logo = (
f"{base_url}/files/workspaces/{tenant.id}/webapp-logo"