Reverts temporarilty the propagation of values for

devices until a clear Device registration strategy takes place
This commit is contained in:
emmdim 2020-03-20 15:48:40 +01:00
parent bd396f0642
commit 4f6eb00d3a
1 changed files with 9 additions and 9 deletions

View File

@ -42,17 +42,17 @@ class DeliverynoteView(View):
'ethereum_address'), partial=True)
d = request.get_json(schema=patch_schema)
dlvnote = Deliverynote.query.filter_by(id=id).one()
device_fields = ['transfer_state', 'deliverynote_address']
computers = [x for x in dlvnote.transferred_devices if isinstance(x, Computer)]
# device_fields = ['transfer_state', 'deliverynote_address']
# computers = [x for x in dlvnote.transferred_devices if isinstance(x, Computer)]
for key, value in d.items():
# Transalate ethereum_address attribute
devKey = key
if key == 'ethereum_address':
devKey = 'deliverynote_address'
setattr(dlvnote, key, value)
if devKey in device_fields:
for dev in computers:
setattr(dev, devKey, value)
# Transalate ethereum_address attribute
# devKey = key
# if key == 'ethereum_address':
# devKey = 'deliverynote_address'
# if devKey in device_fields:
# for dev in computers:
# setattr(dev, devKey, value)
db.session.commit()
return Response(status=204)