fix initialize with empty application
This commit is contained in:
parent
7eb8136cd4
commit
dbf468b586
1 changed files with 7 additions and 1 deletions
|
|
@ -198,7 +198,13 @@ class ChatService:
|
||||||
"answer": INIT_MESSAGES[0],
|
"answer": INIT_MESSAGES[0],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try:
|
||||||
applicant = application["applicants"][0]
|
applicant = application["applicants"][0]
|
||||||
|
except:
|
||||||
|
return {
|
||||||
|
"session_id": session_id,
|
||||||
|
"answer": INIT_MESSAGES[2].format(name=name)
|
||||||
|
}
|
||||||
if not applicant.get("gender") or not applicant.get("dob") or applicant.get("dob") == "-01-" or not applicant.get("weight") or applicant.get("heightFt") is None or applicant.get("heightIn") is None:
|
if not applicant.get("gender") or not applicant.get("dob") or applicant.get("dob") == "-01-" or not applicant.get("weight") or applicant.get("heightFt") is None or applicant.get("heightIn") is None:
|
||||||
return {
|
return {
|
||||||
"session_id": session_id,
|
"session_id": session_id,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue