diff --git a/src/app/domain/people/controllers/persons.py b/src/app/domain/people/controllers/persons.py index e82a8ab8..9b4454fb 100644 --- a/src/app/domain/people/controllers/persons.py +++ b/src/app/domain/people/controllers/persons.py @@ -161,8 +161,8 @@ async def create_person_from_url( work_experiences=[ WorkExperience( starts_at=datetime.strptime(work_ex.get("start_date"), "%Y-%m").date(), - title=work_ex.get("title", {}).get("name"), - company_name=work_ex.get("company", {}).get("name"), + title=work_ex.get("title", {}).get("name", "Unknown"), + company_name=work_ex.get("company", {}).get("name", "Unknown"), company_url=work_ex.get("company", {}).get("website"), company_linkedin_profile_url=work_ex.get("linkedin_url"), ends_at=datetime.strptime(work_ex.get("end_date"), "%Y-%m").date() @@ -170,6 +170,7 @@ async def create_person_from_url( else None, ) for work_ex in person_details.get("experience", []) + if work_ex.get("start_date") and work_ex.get("company", {}) ], company_id=company_db_obj.id, )