clean all previus modifications
This commit is contained in:
parent
14d4d0aed0
commit
c7abf29706
|
@ -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
|
||||
|
|
Reference in New Issue