adding missing defaults when shipcall is not yet created
This commit is contained in:
parent
1150688731
commit
d4e273279b
@ -258,11 +258,11 @@ class InputValidationShipcall():
|
||||
raise ValidationError({"participants":f"every participant id and type should be listed only once. Found multiple entries for one of the participants."})
|
||||
|
||||
@staticmethod
|
||||
def check_shipcall_type_is_unchanged(loadedModel:dict, existing_shipcall:object):
|
||||
def check_shipcall_type_is_unchanged(loadedModel:dict, existing_shipcall:object):
|
||||
if int(loadedModel["type"]) != int(existing_shipcall.type):
|
||||
raise ValidationError({"type":f"The shipcall type may only be set in the initial POST-request. Afterwards, changing the shipcall type is not allowed."}) # @pytest.raises
|
||||
return
|
||||
|
||||
|
||||
@staticmethod
|
||||
def get_shipcall_by_id(shipcall_id:int):
|
||||
query = SQLQuery.get_shipcall_by_id()
|
||||
@ -351,6 +351,10 @@ class InputValidationShipcall():
|
||||
etd = loadedModel.get("etd")
|
||||
tidal_window_from = loadedModel.get("tidal_window_from", None)
|
||||
tidal_window_to = loadedModel.get("tidal_window_to", None)
|
||||
existing_eta = None
|
||||
existing_etd = None
|
||||
existing_tidal_window_from = None
|
||||
existing_tidal_window_to = None
|
||||
|
||||
if existing_shipcall is not None:
|
||||
existing_eta = existing_shipcall.eta
|
||||
|
||||
Loading…
Reference in New Issue
Block a user