Skip to content

Commit

Permalink
fix: 修复无法获取到项目上传时间导致的报错 (#311)
Browse files Browse the repository at this point in the history
  • Loading branch information
he0119 authored Dec 5, 2024
1 parent 4f46d38 commit 9bf11e6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/lang/zh-CN/
### Fixed

- 修复合并插件配置后没有删除对应分支和关闭议题的问题
- 修复无法获取到项目上传时间导致的报错

## [4.1.2] - 2024-12-02

Expand Down
2 changes: 1 addition & 1 deletion src/providers/validation/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class PyPIMixin(BaseModel):
module_name: str
project_link: str

time: str | None = None
time: str
"""上传时间
从 PyPI 获取最新版本的上传时间
Expand Down
7 changes: 6 additions & 1 deletion tests/utils/validation/test_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ async def test_adapter_info_validation_failed(mocked_api: MockRouter) -> None:
"msg": "PyPI 项目名不存在",
"input": "project_link_failed",
},
{
"type": "string_type",
"loc": ("time",),
"msg": "值不是合法的字符串",
"input": None,
},
{
"type": "homepage",
"loc": ("homepage",),
Expand Down Expand Up @@ -101,7 +107,6 @@ async def test_adapter_info_validation_failed(mocked_api: MockRouter) -> None:
},
type=PublishType.ADAPTER,
valid_data={
"time": None,
"name": "name",
"desc": "desc",
"author": "author",
Expand Down

0 comments on commit 9bf11e6

Please sign in to comment.