Skip to content

Commit

Permalink
Update backends.py
Browse files Browse the repository at this point in the history
If the user's fullname does not contain a space the split will crash.
  • Loading branch information
JesseDeLoore authored Jan 23, 2020
1 parent df3d5b1 commit ade7db8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion microsoft_auth/backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,10 @@ def _verify_microsoft_user(self, microsoft_user, data):
fullname = data.get("name")
first_name, last_name = "", ""
if fullname is not None:
first_name, last_name = data["name"].split(" ", 1)
try:
first_name, last_name = data["name"].split(" ", 1)
except ValueError:
pass

try:
# create new Django user from provided data
Expand Down

0 comments on commit ade7db8

Please sign in to comment.