From bd5a4a653a912962b0bdf7713ca5ec0618c96b76 Mon Sep 17 00:00:00 2001 From: Macktireh Date: Sat, 3 Aug 2024 17:58:22 +0200 Subject: [PATCH] Test Bug social auth (google) --- apps/authentication/social_login.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/apps/authentication/social_login.py b/apps/authentication/social_login.py index 0ac63ff..20e680b 100644 --- a/apps/authentication/social_login.py +++ b/apps/authentication/social_login.py @@ -58,15 +58,15 @@ def register_user_with_social_account(auth_provider, email, first_name, last_nam print() print("register_user_with_social_account", auth_provider, email, first_name, last_name) print() - user, created = User.objects.get_or_create( - email=email, - first_name=first_name, - last_name=last_name, - auth_provider=auth_provider, - ) - # try: - # except Exception: - # raise AuthenticationFailed("Something went wrong. Please try again later.") + try: + user, created = User.objects.get_or_create( + email=email, + first_name=first_name, + last_name=last_name, + auth_provider=auth_provider, + ) + except Exception: + raise AuthenticationFailed(f"Get OR Create User: {email} {first_name} {last_name} {auth_provider}.") if created: user.is_verified_email = True