From dc5ef8f29f8bdb32a3b38e18ff0990d582326980 Mon Sep 17 00:00:00 2001 From: nguyen phuc nguyen Date: Thu, 18 Nov 2021 13:10:07 +0700 Subject: [PATCH] Update authentication.py Hi admin, while working on production, my database sometime does not take displayName. The reason is that the user has more than 3 characters. --- drf_firebase_auth/authentication.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drf_firebase_auth/authentication.py b/drf_firebase_auth/authentication.py index a108244..9ff28dd 100755 --- a/drf_firebase_auth/authentication.py +++ b/drf_firebase_auth/authentication.py @@ -134,9 +134,9 @@ def _get_or_create_local_user( and firebase_user.display_name is not None ): display_name = firebase_user.display_name.split(' ') - if len(display_name) == 2: + if len(display_name) >= 2: user.first_name = display_name[0] - user.last_name = display_name[1] + user.last_name = ' '.join(display_name[1:len(display_name)]) user.save() except Exception as e: raise Exception(e)