From 4f6eb00d3a5ded52a2319e20cf5805eac84b95ae Mon Sep 17 00:00:00 2001 From: emmdim Date: Fri, 20 Mar 2020 15:48:40 +0100 Subject: [PATCH] Reverts temporarilty the propagation of values for devices until a clear Device registration strategy takes place --- .../resources/deliverynote/views.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/ereuse_devicehub/resources/deliverynote/views.py b/ereuse_devicehub/resources/deliverynote/views.py index 75834c09..02a1ff8b 100644 --- a/ereuse_devicehub/resources/deliverynote/views.py +++ b/ereuse_devicehub/resources/deliverynote/views.py @@ -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)