F 修复报警联系组删除问题 #43

pull/59/head
vapao 2020-03-27 12:14:39 +08:00
parent 1b5821eadf
commit d0ac0f575e
2 changed files with 2 additions and 2 deletions

View File

@ -40,7 +40,7 @@ class GroupView(View):
Argument('id', type=int, help='请指定操作对象')
).parse(request.GET)
if error is None:
detection = Detection.objects.filter(notify_grp__contains=f'\"{form.id}\"').first()
detection = Detection.objects.filter(notify_grp__regex=fr'\D{form.id}\D').first()
if detection:
return json_response(error=f'监控任务【{detection.name}】正在使用该报警组,请解除关联后再尝试删除该联系组')
Group.objects.filter(pk=form.id).delete()

View File

@ -72,7 +72,7 @@ class ComTable extends React.Component {
title: '删除确认',
content: `确定要删除【${text['name']}】?`,
onOk: () => {
return http.delete('/api/exec/template/', {params: {id: text.id}})
return http.delete('/api/alarm/group/', {params: {id: text.id}})
.then(() => {
message.success('删除成功');
store.fetchRecords()