diff --git a/infrastructure/abri/abri_client.py b/infrastructure/abri/abri_client.py index 3f9cc19b0..4cfe51d7e 100644 --- a/infrastructure/abri/abri_client.py +++ b/infrastructure/abri/abri_client.py @@ -49,15 +49,18 @@ class AbriClient: return self._parse_job_logged(outcome) def amend_job(self, request: AmendJobRequest) -> AmendJobResult: + parameters = [ + ("job_no", request.job_no), + ("action", "amend"), + ("appointment_date", request.appointment_date.strftime("%d/%m/%Y")), + ("appointment_time", request.appointment_time), + ] + if request.resource is not None: + parameters.append(("resource", request.resource)) + outcome = self._exchange( request_type="amendoptiappt", - parameters=[ - ("job_no", request.job_no), - ("action", "amend"), - ("appointment_date", request.appointment_date.strftime("%d/%m/%Y")), - ("appointment_time", request.appointment_time), - ("resource", request.resource or ""), - ], + parameters=parameters, ) if isinstance(outcome, AbriRequestRejected):