Commit fb8cb1cd authored by Kerwin_Cui's avatar Kerwin_Cui

编辑必填项

parent 39618130
......@@ -2390,6 +2390,15 @@ def edit_alarm(request):
alarm_time = data['alarm_time']
recover_time = data['recover_time']
alarm_summary = data['alarm_summary']
if recover_time is None or alarm_time is None:
return render_json(
{
"result": False,
"code": 1,
"message": u"有必填字段未填写!",
"data": {}
}
)
if_interpose = data['if_interpose']
solve_process = data['solve_process']
if_workday = data['if_workday']
......@@ -2411,7 +2420,17 @@ def edit_alarm(request):
# recover_time = recover_time[0:-5]
recover_time = datetime.datetime.strptime(recover_time, "%Y-%m-%d %H:%M:%S")
recover_time = (recover_time + datetime.timedelta(hours=8))
if alarm_time and recover_time and alarm_summary and alarm_type and alarm_system:
pass
else:
return render_json(
{
"result": False,
"code": 1,
"message": u"有必填字段未填写!",
"data": {}
}
)
alarm = Error_alarm.objects.get(alarm_number=alarm_number)
alarm.alarm_number = alarm_number
alarm.alarm_level = alarm_type
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment