fixed POST when a null evaluation enum is sent

This commit is contained in:
Daniel Schick 2024-04-08 13:49:52 +02:00
parent 40fd77bf6c
commit 08dd104284

View File

@ -194,8 +194,12 @@ class ShipcallSchema(Schema):
@post_load
def make_shipcall(self, data, **kwargs):
if 'type' in data:
data['type_value'] = data['type'].value
else:
data['type_value'] = ShipcallType.undefined
if 'evaluation' in data:
if data['evaluation']:
data['evaluation_value'] = data['evaluation'].value
else:
data['evaluation_value'] = EvaluationType.undefined