fixed view

This commit is contained in:
Cayo Puigdefabregas 2020-10-16 15:26:12 +02:00
parent 139c1e290a
commit 14d4d0aed0
1 changed files with 3 additions and 2 deletions

View File

@ -70,6 +70,7 @@ 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: for d in action.devices:
d.updated = datetime.now() d.updated = datetime.now()
db.session.add(action) db.session.add(action)