Skip to content

Commit

Permalink
Add checks when adding a person
Browse files Browse the repository at this point in the history
  • Loading branch information
shri committed Sep 5, 2024
1 parent 4f67741 commit 93b0e12
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/app/domain/people/controllers/persons.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,15 +161,16 @@ 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()
if work_ex.get("end_date")
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,
)
Expand Down

0 comments on commit 93b0e12

Please sign in to comment.