clean all previus modifications
This commit is contained in:
parent
14d4d0aed0
commit
c7abf29706
|
@ -70,9 +70,6 @@ class ActionView(View):
|
||||||
return self.transfer_ownership()
|
return self.transfer_ownership()
|
||||||
Model = db.Model._decl_class_registry.data[json['type']]()
|
Model = db.Model._decl_class_registry.data[json['type']]()
|
||||||
action = Model(**a)
|
action = Model(**a)
|
||||||
if hasattr(action, 'devices'):
|
|
||||||
for d in action.devices:
|
|
||||||
d.updated = datetime.now()
|
|
||||||
db.session.add(action)
|
db.session.add(action)
|
||||||
db.session().final_flush()
|
db.session().final_flush()
|
||||||
ret = self.schema.jsonify(action)
|
ret = self.schema.jsonify(action)
|
||||||
|
@ -146,8 +143,6 @@ class ActionView(View):
|
||||||
if snapshot.device.hid is None:
|
if snapshot.device.hid is None:
|
||||||
snapshot.severity = Severity.Warning
|
snapshot.severity = Severity.Warning
|
||||||
db.session.add(snapshot)
|
db.session.add(snapshot)
|
||||||
for action in snapshot.actions:
|
|
||||||
action.device.updated = datetime.now()
|
|
||||||
db.session().final_flush()
|
db.session().final_flush()
|
||||||
ret = self.schema.jsonify(snapshot) # transform it back
|
ret = self.schema.jsonify(snapshot) # transform it back
|
||||||
ret.status_code = 201
|
ret.status_code = 201
|
||||||
|
|
Reference in a new issue