From 7e9c121ad3ffa9a00971d68e072391b7dbe34a5a Mon Sep 17 00:00:00 2001 From: Jason Michalski Date: Thu, 29 Jan 2015 00:00:23 -0800 Subject: [PATCH] Use the full_name if available We were trying to default the users first name when using google auth, but it was getting lost when rendering the form. (imported from commit 710e0c2ce591488920458dca74209c75e7031abd) --- zerver/views/__init__.py | 4 ++++ zproject/local_settings.py | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/zerver/views/__init__.py b/zerver/views/__init__.py index 4da41bf2d9..f2f19cf4af 100644 --- a/zerver/views/__init__.py +++ b/zerver/views/__init__.py @@ -333,6 +333,10 @@ def accounts_register(request): except TypeError: # Let the user fill out a name and/or try another backend form = RegistrationForm() + elif 'full_name' in request.POST: + form = RegistrationForm( + initial={'full_name': request.POST.get('full_name')} + ) else: form = RegistrationForm() else: diff --git a/zproject/local_settings.py b/zproject/local_settings.py index b122ce82b7..faeb08dece 100644 --- a/zproject/local_settings.py +++ b/zproject/local_settings.py @@ -144,8 +144,8 @@ else: GOOGLE_CLIENT_ID = "835904834568-77mtr5mtmpgspj9b051del9i9r5t4g4n.apps.googleusercontent.com" if DEPLOYED: - GOOGLE_OAUTH2_CLIENT_ID = '' - GOOGLE_OAUTH2_CLIENT_SECRET = '' + GOOGLE_OAUTH2_CLIENT_ID = '835904834568-ag4p18v0sd9a0tero14r3gekn6shoen3.apps.googleusercontent.com' + GOOGLE_OAUTH2_CLIENT_SECRET = 'xxxxxxxxxxxxxxxxxxxxxxxx' else: # Google OAUTH2 for dev with the redirect uri set to http://localhost:9991/accounts/login/google/done/ GOOGLE_OAUTH2_CLIENT_ID = '607830223128-4qgthc7ofdqce232dk690t5jgkm1ce33.apps.googleusercontent.com'