take into account user deleting their account in the meantime

This commit is contained in:
Son NK 2020-02-15 17:10:49 +07:00
parent c59187531e
commit 9e2121825d
1 changed files with 4 additions and 2 deletions

View File

@ -75,8 +75,10 @@ if __name__ == "__main__":
user_id = job.payload.get("user_id")
user = User.get(user_id)
LOG.d("run onboarding_1 for user %s", user)
onboarding_1(user)
# user might delete their account in the meantime
if user:
LOG.d("run onboarding_1 for user %s", user)
onboarding_1(user)
else:
LOG.error("Unknown job name %s", job.name)