auth: Set valid_attestation more unconditionally in social auth.

This commit is contained in:
Tim Abbott
2017-11-21 15:41:18 -08:00
committed by Greg Price
parent ade5b4ea69
commit 665fc594db
2 changed files with 4 additions and 4 deletions

View File

@@ -431,7 +431,7 @@ class GitHubAuthBackendTest(ZulipTestCase):
kwargs = {'realm': get_realm('zulip'),
'response': response,
'return_data': {}}
'return_data': {'valid_attestation': True}}
result.assert_called_with(self.user_profile, 'fake-access-token', **kwargs)
def test_github_backend_do_auth_for_default_auth_failed(self):
@@ -461,7 +461,7 @@ class GitHubAuthBackendTest(ZulipTestCase):
kwargs = {'realm': get_realm('zulip'),
'response': response,
'return_data': {}}
'return_data': {'valid_attestation': True}}
result.assert_called_with(self.user_profile, 'fake-access-token', **kwargs)
def test_github_backend_do_auth_for_team_auth_failed(self):
@@ -491,7 +491,7 @@ class GitHubAuthBackendTest(ZulipTestCase):
kwargs = {'realm': get_realm('zulip'),
'response': response,
'return_data': {}}
'return_data': {'valid_attestation': True}}
result.assert_called_with(self.user_profile, 'fake-access-token', **kwargs)
def test_github_backend_do_auth_for_org_auth_failed(self):

View File

@@ -206,8 +206,8 @@ class SocialAuthMixin(ZulipAuthMixin):
try:
user_profile = get_user_profile_by_email(email_address)
except UserProfile.DoesNotExist:
return_data["valid_attestation"] = True
return None
return_data["valid_attestation"] = True
if not user_profile.is_active:
return_data["inactive_user"] = True