fix: 修复【系统管理】创建模型,没有校验 (#867)

This commit is contained in:
shaohuzhang1 2024-07-25 14:53:04 +08:00 committed by GitHub
parent 0531aa59b9
commit ad0592552b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -161,10 +161,10 @@ class ModelSerializer(serializers.Serializer):
if QuerySet(Model).filter(user_id=self.data.get('user_id'),
name=self.data.get('name')).exists():
raise AppApiException(500, f'模型名称【{self.data.get("name")}】已存在')
# 校验模型认证数据
ModelProvideConstants[self.data.get('provider')].value.is_valid_credential(self.data.get('model_type'),
self.data.get('model_name'),
self.data.get('credential')
self.data.get('credential'),
raise_exception=True
)
def insert(self, user_id, with_valid=False):