fix: 清理错误定时策略并支持生成cron文本

This commit is contained in:
caoqianming 2023-08-06 23:29:15 +08:00
parent cf4a40b960
commit 6b47caf6e7
1 changed files with 4 additions and 4 deletions

View File

@ -7948,10 +7948,10 @@ def apimyschedule(req):
'month_of_year': data['month_of_year'],
'timezone': 'Asia/Shanghai'
}
name = '测试'
# name = get_chinese_description('crontab', cron)
# if name == '':
# return JsonResponse({'code': 0, 'msg': '时间配置格式错误'})
# name = '测试'
name = get_chinese_description('crontab', cron)
if name == '':
return JsonResponse({'code': 0, 'msg': '时间配置格式错误'})
iobj, b = CrontabSchedule.objects.get_or_create(**cron, defaults=cron)
MySchedule.objects.create(name=name, typeset=data['set'], crontab=iobj, usecomp=Partment.objects.get(partid=companyid))
return JsonResponse({'code': 1})