fix: 【知识库】知识库设置,web站点地址格式错误,保存报错

This commit is contained in:
shaohuzhang1 2024-03-04 11:01:58 +08:00
parent 0f42d0e9b2
commit b153ca9e59
2 changed files with 3 additions and 1 deletions

View File

@ -9,6 +9,8 @@ import html2text as ht
from bs4 import BeautifulSoup
from urllib.parse import urljoin, urlparse, ParseResult, urlsplit, parse_qs
from common.exception.app_exception import AppApiException
requests.packages.urllib3.disable_warnings()

View File

@ -48,7 +48,7 @@ class MetaSerializer(serializers.Serializer):
source_url = self.data.get('source_url')
response = Fork(source_url, []).fork()
if response.status == 500:
raise AppApiException(500, response.message)
raise AppApiException(500, f"url错误,无法解析【{source_url}")
class BaseMeta(serializers.Serializer):
def is_valid(self, *, raise_exception=False):