fixing bug of trade without devices

This commit is contained in:
Cayo Puigdefabregas 2021-10-01 13:30:39 +02:00
parent 2d305f5a43
commit 920937a51f

View file

@ -707,6 +707,11 @@ class Trade(ActionWithMultipleDevices):
required=True, required=True,
only_query='id') only_query='id')
@pre_load
def adding_devices(self, data: dict):
if not 'devices' in data.keys():
data['devices'] = []
@validates_schema @validates_schema
def validate_lot(self, data: dict): def validate_lot(self, data: dict):
if not g.user.email in [data['user_from_email'], data['user_to_email']]: if not g.user.email in [data['user_from_email'], data['user_to_email']]: