From c48ff1784c7fa5434cf281cdcc79dd4e81e272d8 Mon Sep 17 00:00:00 2001 From: Luke Faraone Date: Tue, 23 Apr 2013 14:46:12 -0700 Subject: [PATCH] Implement OpenID signups. This allows users on signup-eligible domains to sign up for Humbug using Google Apps. As part of this, we wrap the openid done view in our own code in order to handle the "Unknown user" error. Therein, we create a PreregistrationUser and then shunt the user through the rest of the confirmation process, pre- filling in their name. (imported from commit 066d9a1021384a6da2662352e62a701451bd6f44) --- humbug/urls.py | 1 + .../confirm_preregistrationuser.html | 1 + templates/zephyr/register.html | 6 ++- zephyr/views.py | 39 ++++++++++++++++++- 4 files changed, 44 insertions(+), 3 deletions(-) diff --git a/humbug/urls.py b/humbug/urls.py index 89b4de0e2c..8640f92d51 100644 --- a/humbug/urls.py +++ b/humbug/urls.py @@ -16,6 +16,7 @@ import zephyr.forms urlpatterns = patterns('', url(r'^$', 'zephyr.views.home'), url(r'^accounts/login/openid/$', 'django_openid_auth.views.login_begin', name='openid-login'), + url(r'^accounts/login/openid/done/$', 'zephyr.views.process_openid_login', name='openid-complete'), url(r'^accounts/login/openid/done/$', 'django_openid_auth.views.login_complete', name='openid-complete'), # We have two entries for accounts/login to allow reverses on the Django # view we're wrapping to continue to function. diff --git a/templates/confirmation/confirm_preregistrationuser.html b/templates/confirmation/confirm_preregistrationuser.html index 3d2cbb17a8..a8946cf7e4 100644 --- a/templates/confirmation/confirm_preregistrationuser.html +++ b/templates/confirmation/confirm_preregistrationuser.html @@ -12,6 +12,7 @@ post to another view which executes in our code to produce the desired form. {% csrf_token %} +