🐛 fix assign render error

This commit is contained in:
yanyongyu 2021-08-21 00:10:15 +08:00
parent 8b0c4618c7
commit 7cceb4bb80
4 changed files with 19 additions and 15 deletions

View File

@ -4,7 +4,7 @@
@Author : yanyongyu
@Date : 2021-03-11 16:57:04
@LastEditors : yanyongyu
@LastEditTime : 2021-08-20 23:32:41
@LastEditTime : 2021-08-20 23:52:12
@Description : None
@GitHub : https://github.com/yanyongyu
"""
@ -53,7 +53,7 @@ class Issue(BaseModel):
number: int
state: str
title: str
body: str
body: Optional[str]
body_text: Optional[str]
body_html: Optional[str]
user: User

View File

@ -4,7 +4,7 @@
@Author : yanyongyu
@Date : 2021-05-14 00:57:33
@LastEditors : yanyongyu
@LastEditTime : 2021-08-20 23:31:52
@LastEditTime : 2021-08-20 23:57:43
@Description : None
@GitHub : https://github.com/yanyongyu
"""
@ -133,7 +133,7 @@ class TimelineEventCommentDeleted(TimelineEvent):
# Issue assigned to Person
class TimelineEventAssigned(TimelineEvent):
type: Literal["assigned"]
event: Literal["assigned"]
id: int
node_id: str
url: str
@ -142,7 +142,7 @@ class TimelineEventAssigned(TimelineEvent):
commit_url: Optional[str]
created_at: datetime
assignee: Actor
assigner: Actor
assigner: Optional[Actor] = None
# Issue Mentioned Person
@ -317,7 +317,7 @@ class TimelineEventMerged(TimelineEvent):
# Pull Request Deployed
class TimelineEventDeployed(TimelineEvent):
type: Literal["deployed"]
event: Literal["deployed"]
id: int
node_id: str
url: str

View File

@ -2,7 +2,7 @@
* @Author : yanyongyu
* @Date : 2021-08-20 23:33:46
* @LastEditors : yanyongyu
* @LastEditTime : 2021-08-20 23:37:56
* @LastEditTime : 2021-08-20 23:49:02
* @Description : None
* @GitHub : https://github.com/yanyongyu
-->
@ -25,20 +25,23 @@
</svg>
</div>
<div class="TimelineItem-body">
{% set self_request = event.assigner.login == event.assignee.login %}
<!-- prettier-ignore -->
{% if event.assigner -%}
{% set assigner = event.assigner %}
{%- else -%}
{% set assigner = event.assignee %}
{%- endif %}
<a class="d-inline-block">
<img
class="avatar avatar-user"
height="20"
width="20"
src="{{ event.assigner.avatar_url }}"
src="{{ assigner.avatar_url }}"
/>
</a>
<a class="author Link--primary text-bold">
{{ event.assigner.login|escape }}
</a>
<a class="author Link--primary text-bold">{{ assigner.login|escape }}</a>
<!-- prettier-ignore -->
{% if self_request -%}
{% if assigner == event.assignee -%}
self-assigned this
{%- else -%}
assigned

View File

@ -4,7 +4,7 @@
@Author : yanyongyu
@Date : 2021-03-09 15:15:02
@LastEditors : yanyongyu
@LastEditTime : 2021-08-19 23:19:12
@LastEditTime : 2021-08-20 23:58:58
@Description : None
@GitHub : https://github.com/yanyongyu
"""
@ -127,7 +127,8 @@ async def handle_short(bot: Bot, event: GroupMessageEvent, state: T_State):
img = await issue_to_image(owner, repo, issue_)
except TimeoutException:
await issue.finish(f"获取issue数据超时请尝试重试")
except Error:
except Error as e:
print(repr(e))
await issue.finish(f"生成图片超时!请尝试重试")
else:
if img: