diff --git a/src/bk-user/bkuser/apis/web/tenant/serializers.py b/src/bk-user/bkuser/apis/web/tenant/serializers.py index f4022bbda..218ae1fbd 100644 --- a/src/bk-user/bkuser/apis/web/tenant/serializers.py +++ b/src/bk-user/bkuser/apis/web/tenant/serializers.py @@ -100,7 +100,9 @@ def get_data_sources(self, obj: Tenant) -> List[Dict]: class TenantUpdateInputSLZ(serializers.Serializer): name = serializers.CharField(help_text="租户名称") - logo = serializers.CharField(help_text="租户 Logo", required=False, default=settings.DEFAULT_TENANT_LOGO) + logo = serializers.CharField( + help_text="租户 Logo", required=False, allow_blank=True, default=settings.DEFAULT_TENANT_LOGO + ) manager_ids = serializers.ListField(child=serializers.CharField(), help_text="租户用户 ID 列表", allow_empty=False) feature_flags = TenantFeatureFlagSLZ(help_text="租户特性集") diff --git a/src/bk-user/bkuser/biz/tenant.py b/src/bk-user/bkuser/biz/tenant.py index 8e704dfbc..010bc6f6e 100644 --- a/src/bk-user/bkuser/biz/tenant.py +++ b/src/bk-user/bkuser/biz/tenant.py @@ -12,6 +12,7 @@ from typing import Dict, List, Optional from django.db import transaction +from django.utils.timezone import now from pydantic import BaseModel from bkuser.apps.data_source.models import ( @@ -307,7 +308,7 @@ def update_with_managers(tenant_id: str, tenant_info: TenantEditableBaseInfo, ma with transaction.atomic(): # 更新基本信息 - Tenant.objects.filter(id=tenant_id).update(**tenant_info.model_dump()) + Tenant.objects.filter(id=tenant_id).update(updated_at=now(), **tenant_info.model_dump()) if should_deleted_manager_ids: TenantManager.objects.filter(