perf: 优化消息通知 (#7024)

* perf: 优化系统用户列表

* stash

* perf: 优化消息通知

* perf: 修改钉钉

* perf: 修改优化消息通知

* perf: 修改requirements

* perf: 优化datetime

Co-authored-by: ibuler <ibuler@qq.com>
This commit is contained in:
fit2bot
2021-10-20 19:45:37 +08:00
committed by GitHub
parent 9acfd461b4
commit 00d434ceea
39 changed files with 948 additions and 1738 deletions

View File

@@ -1,4 +1,4 @@
from common.utils.timezone import now
from common.utils.timezone import local_now
def contains_time_period(time_periods):
@@ -8,8 +8,8 @@ def contains_time_period(time_periods):
if not time_periods:
return False
current_time = now().strftime('%H:%M')
today_time_period = next(filter(lambda x: str(x['id']) == now().strftime("%w"), time_periods))
current_time = local_now().strftime('%H:%M')
today_time_period = next(filter(lambda x: str(x['id']) == local_now().strftime("%w"), time_periods))
for time in today_time_period['value'].split(''):
start, end = time.split('~')
end = "24:00" if end == "00:00" else end