From 8dc31eddd2125061025e9eee6019c5e28d5fee15 Mon Sep 17 00:00:00 2001 From: Dinesh Date: Tue, 7 Jul 2020 10:51:05 +0530 Subject: [PATCH 1/2] Fix AppleIdAuth backend filling user details with None. It's a general convention that this project follows to use '' instead of `None`. Most of of the other backends use ''. --- social_core/backends/apple.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/social_core/backends/apple.py b/social_core/backends/apple.py index e74e19e5a..a78c0e664 100644 --- a/social_core/backends/apple.py +++ b/social_core/backends/apple.py @@ -142,10 +142,9 @@ def get_user_details(self, response): email = response.get('email', '') apple_id = response.get(self.ID_KEY, '') - # prevent updating User with empty strings user_details = { - 'first_name': first_name or None, - 'last_name': last_name or None, + 'first_name': first_name, + 'last_name': last_name, 'email': email, } if email and self.setting('EMAIL_AS_USERNAME'): From 1731bb026d6ada9b75d91d78bc747a0365f70304 Mon Sep 17 00:00:00 2001 From: Dinesh Date: Tue, 7 Jul 2020 11:16:58 +0530 Subject: [PATCH 2/2] Fix SAMLIdentityProvider backend filling user details with None. It's a general convention that this project follows to use '' instead of `None`. Most of of the other backends use ''. --- social_core/backends/saml.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/social_core/backends/saml.py b/social_core/backends/saml.py index 985d37edb..104505d9c 100644 --- a/social_core/backends/saml.py +++ b/social_core/backends/saml.py @@ -79,7 +79,7 @@ def get_attr(self, attributes, conf_key, default_attribute): if len(value): value = value[0] else: - value = None + value = '' return value @property