resolving the validation issue in shipcalls, which was caused by a faulty fields type in the ShipcallSchema.

This commit is contained in:
Max Metz 2024-07-31 14:59:59 +02:00
parent cc724bdb30
commit 5769889fea

View File

@ -205,8 +205,7 @@ class ShipcallSchema(Schema):
id = fields.Integer(metadata={'required':True})
ship_id = fields.Integer(metadata={'required':True})
#type = fields.Enum(ShipcallType, default=ShipcallType.undefined) # type = fields.Integer() # make enum: shipcall type. add validator
type = fields.Integer(metadata={'required':True}) # make enum: shipcall type. add validator # type = fields.Enum(ShipcallType, default=ShipcallType.undefined) # type = fields.Integer() # make enum: shipcall type. add validator
type = fields.Enum(ShipcallType, default=ShipcallType.undefined)
eta = fields.DateTime(metadata={'required':False}, allow_none=True)
voyage = fields.String(allow_none=True, metadata={'Required':False}, validate=[validate.Length(max=16)]) # Solving: RemovedInMarshmallow4Warning: Passing field metadata as keyword arguments is deprecated. Use the explicit `metadata=...` argument instead. Additional metadata: {'Required': False}
etd = fields.DateTime(metadata={'required':False}, allow_none=True)