Skip to content

Commit fe510fb

Browse files
committed
remove: 删除多余代码
1 parent e906b70 commit fe510fb

File tree

2 files changed

+1
-19
lines changed

2 files changed

+1
-19
lines changed

src/utils/validation/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def validate_info(
100100
)
101101

102102
return {
103-
"valid": errors == [],
103+
"valid": not errors,
104104
"data": data,
105105
"errors": errors,
106106
# 方便插件使用的数据

src/utils/validation/models.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -150,12 +150,6 @@ def tags_validator(cls, v: str) -> list[dict[str, str]]:
150150
raise PydanticCustomError("json_type", "JSON 格式不合法")
151151
return tags
152152

153-
@classmethod
154-
@abc.abstractmethod
155-
def get_type(cls) -> PublishType:
156-
"""获取发布类型"""
157-
raise NotImplementedError
158-
159153

160154
class PluginPublishInfo(PublishInfo, PyPIMixin):
161155
"""发布插件所需信息"""
@@ -213,22 +207,10 @@ def supported_adapters_validator(
213207
)
214208
return sorted(supported_adapters)
215209

216-
@classmethod
217-
def get_type(cls) -> PublishType:
218-
return PublishType.PLUGIN
219-
220210

221211
class AdapterPublishInfo(PublishInfo, PyPIMixin):
222212
"""发布适配器所需信息"""
223213

224-
@classmethod
225-
def get_type(cls) -> PublishType:
226-
return PublishType.ADAPTER
227-
228214

229215
class BotPublishInfo(PublishInfo):
230216
"""发布机器人所需信息"""
231-
232-
@classmethod
233-
def get_type(cls) -> PublishType:
234-
return PublishType.BOT

0 commit comments

Comments
 (0)