clean all previus modifications

This commit is contained in:
Cayo Puigdefabregas 2020-10-16 16:24:48 +02:00
parent 14d4d0aed0
commit c7abf29706

View file

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