Montrer les infos d'éligibilité dès qu'elles deviennent disponibles
This commit is contained in:
parent
2a3c1af043
commit
419f37d875
1 changed files with 4 additions and 1 deletions
|
@ -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")
|
||||
|
|
Loading…
Reference in a new issue