diff --git a/ereuse_devicehub/resources/action/schemas.py b/ereuse_devicehub/resources/action/schemas.py index ec11dd8f..5a1bb38c 100644 --- a/ereuse_devicehub/resources/action/schemas.py +++ b/ereuse_devicehub/resources/action/schemas.py @@ -707,6 +707,11 @@ class Trade(ActionWithMultipleDevices): required=True, only_query='id') + @pre_load + def adding_devices(self, data: dict): + if not 'devices' in data.keys(): + data['devices'] = [] + @validates_schema def validate_lot(self, data: dict): if not g.user.email in [data['user_from_email'], data['user_to_email']]: