fixed POST when a null evaluation enum is sent
This commit is contained in:
parent
40fd77bf6c
commit
08dd104284
@ -62,7 +62,7 @@ class ShipcallType(IntEnum):
|
||||
arrival = 1
|
||||
departure = 2
|
||||
shifting = 3
|
||||
|
||||
|
||||
@classmethod
|
||||
def _missing_(cls, value):
|
||||
return cls.undefined
|
||||
@ -194,9 +194,13 @@ class ShipcallSchema(Schema):
|
||||
|
||||
@post_load
|
||||
def make_shipcall(self, data, **kwargs):
|
||||
data['type_value'] = data['type'].value
|
||||
if 'type' in data:
|
||||
data['type_value'] = data['type'].value
|
||||
else:
|
||||
data['type_value'] = ShipcallType.undefined
|
||||
if 'evaluation' in data:
|
||||
data['evaluation_value'] = data['evaluation'].value
|
||||
if data['evaluation']:
|
||||
data['evaluation_value'] = data['evaluation'].value
|
||||
else:
|
||||
data['evaluation_value'] = EvaluationType.undefined
|
||||
return data
|
||||
|
||||
Reference in New Issue
Block a user