From b31f315a76b0fb810850ca918c325779f13282e3 Mon Sep 17 00:00:00 2001 From: emmdim Date: Wed, 18 Dec 2019 16:37:45 +0100 Subject: [PATCH] Adds 'author_id' in /lot PATCH --- ereuse_devicehub/resources/lot/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ereuse_devicehub/resources/lot/views.py b/ereuse_devicehub/resources/lot/views.py index 37ff1c8c..6cadc116 100644 --- a/ereuse_devicehub/resources/lot/views.py +++ b/ereuse_devicehub/resources/lot/views.py @@ -41,10 +41,10 @@ class LotView(View): return ret def patch(self, id): - patch_schema = self.resource_def.SCHEMA(only=('name', 'description', 'transfer_state', 'receiver_id', 'deposit', 'delivery_note_address', 'devices'), partial=True) + patch_schema = self.resource_def.SCHEMA(only=('name', 'description', 'transfer_state', 'receiver_id', 'deposit', 'delivery_note_address', 'devices', 'author_id'), partial=True) l = request.get_json(schema=patch_schema) lot = Lot.query.filter_by(id=id).one() - device_fields = ['transfer_state', 'receiver_id', 'deposit', 'delivery_note_address'] + device_fields = ['transfer_state', 'receiver_id', 'deposit', 'delivery_note_address', 'author_id'] computers = [x for x in lot.all_devices if isinstance(x, Computer)] for key, value in l.items(): setattr(lot, key, value)