mirror of
https://github.com/pds-nest/nest.git
synced 2025-02-16 12:43:58 +00:00
Fix minor issue
This commit is contained in:
parent
348dd91132
commit
5f68ced84b
2 changed files with 6 additions and 6 deletions
|
@ -36,10 +36,10 @@ class BoolOperation(ext.Model):
|
|||
"node_2": self.node_2.to_json() if self.node_2 else None
|
||||
}
|
||||
|
||||
def get_chain_ids(self, l):
|
||||
if self.id in l:
|
||||
def get_chain_ids(self, lista):
|
||||
if self.id in lista:
|
||||
# Loop detected!
|
||||
return -1
|
||||
l.append(self.id)
|
||||
self.get_chain_ids(self.node_1, l)
|
||||
self.get_chain_ids(self.node_2, l)
|
||||
lista.append(self.id)
|
||||
self.node_1.get_chain_ids(lista)
|
||||
self.node_1.get_chain_ids(lista)
|
||||
|
|
|
@ -175,7 +175,7 @@ def page_alert(aid):
|
|||
type_ = OperationType(type_)
|
||||
except KeyError:
|
||||
return json_error("Unknown `operation` specified."), 400
|
||||
root = BoolOperation(operation=type_, is_root=True, alert_id=aid)
|
||||
root = BoolOperation(operation=type_, is_root=True, alert_id=aid, condition_id=condition_id)
|
||||
ext.session.add(root)
|
||||
ext.session.commit()
|
||||
root = BoolOperation.filter_by(id=request.json['root_operation']['id']).first()
|
||||
|
|
Loading…
Add table
Reference in a new issue