Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions HackathonBot/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,13 @@ def process_issue(task_text, config):
"""
task_list = []
for i in range(config['max_task_id']):
start = task_text.find('| {} |'.format(i + 1))
exists = re.search(r'\|\s*{}\s*\|'.format(i+1), task_text)
# 如果没有找到该编号的任务,直接返回
if start < 0:
if exists is None:
logger.error('没有从issue内容中找到编号为【{}】的赛题,请检查issue内容格式是否正确'.format(str(i + 1)))
task_list.append(None)
continue
start = exists.span()[0]
end = start + 1
column = 0
task = {}
Expand Down Expand Up @@ -492,4 +493,4 @@ def update_statistic_info(task_list, config):
for user_name in users_info:
statistic_info += "@{} ({}) ".format(user_name, str(users_info[user_name]))
statistic_info += "\n"
return statistic_info
return statistic_info