Reverts temporarilty the propagation of values for
devices until a clear Device registration strategy takes place
This commit is contained in:
parent
bd396f0642
commit
4f6eb00d3a
|
@ -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)
|
||||
|
|
Reference in a new issue