fixed view
This commit is contained in:
parent
139c1e290a
commit
14d4d0aed0
|
@ -70,8 +70,9 @@ 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)
|
||||||
for d in action.devices:
|
if hasattr(action, 'devices'):
|
||||||
d.updated = datetime.now()
|
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)
|
||||||
|
|
Reference in New Issue