Merge pull request #7057 from jumpserver/pr@dev@acl_bug

fix: 修复acl 选择时间段为空bug
pull/7059/head
feng626 2021-10-22 16:12:40 +08:00 committed by GitHub
commit 705f352cb9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -10,6 +10,10 @@ def contains_time_period(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))
today_time_period = today_time_period['value']
if not today_time_period:
return False
for time in today_time_period['value'].split(''):
start, end = time.split('~')
end = "24:00" if end == "00:00" else end