Skip to content

Commit

Permalink
Merge pull request #229 from StartupsPoleEmploi/acantin/peam_fix_key_…
Browse files Browse the repository at this point in the history
…error_when_no_family_name

No key error if peam user has no family_name
  • Loading branch information
AlexandreCantin committed Jul 19, 2018
2 parents 6c011d9 + b409d49 commit 0ac93bf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion labonneboite/web/auth/backends/peam.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def get_user_details(self, response):
'external_id': response['sub'],
'gender': response['gender'],
'first_name': response['given_name'],
'last_name': response['family_name'],
'last_name': response['family_name'] if 'family_name' in response else None,
}
except KeyError as e:
# Sometimes PEAM responds without the user details.
Expand Down

0 comments on commit 0ac93bf

Please sign in to comment.