diff --git a/webapp/netwo/netwo.py b/webapp/netwo/netwo.py index 7a3d731..6d699af 100644 --- a/webapp/netwo/netwo.py +++ b/webapp/netwo/netwo.py @@ -160,6 +160,7 @@ class Netwo: "imb_ref": imb_info.get("imb_id"), "pm_ref": imb_info.get("pm_id"), } + netwo_elig["imb_info"] = imb_info response = requests.post( "https://api.netwo.io/api/v1/eligibility", headers=self.netwo_api_headers, @@ -204,6 +205,9 @@ class Netwo: + netwo_elig["nbOperatorsErrors"] + netwo_elig["nbOperatorsPending"] ) + netwo_elig["eligOffers"] = self.get_netwo_eligibility_results( + id_elig, search_ftto + ) if timeout and time.time() > timeout: netwo_elig["timeoutReached"] = True yield json.dumps(netwo_elig, indent=2) @@ -222,7 +226,6 @@ class Netwo: id_elig, search_ftto ) netwo_elig["eligDone"] = True - netwo_elig["imb_info"] = imb_info yield json.dumps(netwo_elig, indent=2) return Response(event_stream(), mimetype="text/event-stream")