From: hernani Date: Tue, 11 May 2010 13:00:08 +0000 (+0000) Subject: Kill that annoying problem that when users without a valid email at register time... X-Git-Tag: live~911 X-Git-Url: https://git.openstreetmap.org/osqa.git/commitdiff_plain/5b07c7b5b515a3b89da2cd3cfc46e1842dbdc328 Kill that annoying problem that when users without a valid email at register time had to repeat the login proccess. git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@218 0cfe37f9-358a-4d5e-be75-b63607b5c754 --- diff --git a/forum/views/auth.py b/forum/views/auth.py index f9d299d..3d61575 100644 --- a/forum/views/auth.py +++ b/forum/views/auth.py @@ -169,10 +169,7 @@ def external_register(request): del request.session['assoc_key'] del request.session['auth_provider'] - if user_.email_isvalid: - return login_and_forward(request, user_) - else: - return HttpResponseRedirect(reverse('index')) + return login_and_forward(request, user_) else: provider_class = AUTH_PROVIDERS[request.session['auth_provider']].consumer user_data = provider_class.get_user_data(request.session['assoc_key']) diff --git a/forum_modules/openidauth/authentication.py b/forum_modules/openidauth/authentication.py index 9163b5c..dfd337f 100644 --- a/forum_modules/openidauth/authentication.py +++ b/forum_modules/openidauth/authentication.py @@ -47,8 +47,8 @@ class MyOpenIdAuthConsumer(OpenIdAbstractAuthConsumer): dataype2ax_schema = { #'username': ('http://schema.openid.net/namePerson/friendly', 'friendly'), 'email': 'http://schema.openid.net/contact/email', - 'web': 'http://schema.openid.net/contact/web/default', - 'birthdate': ('http://schema.openid.net/birthDate', 'birthDate'), + #'web': 'http://schema.openid.net/contact/web/default', + #'birthdate': ('http://schema.openid.net/birthDate', 'birthDate'), } def get_user_url(self, request): diff --git a/forum_modules/openidauth/consumer.py b/forum_modules/openidauth/consumer.py index 22e83d2..cc1e97d 100644 --- a/forum_modules/openidauth/consumer.py +++ b/forum_modules/openidauth/consumer.py @@ -18,12 +18,12 @@ from store import OsqaOpenIDStore class OpenIdAbstractAuthConsumer(AuthenticationConsumer): dataype2ax_schema = { - 'username': 'http://axschema.org/namePerson/friendly', + #'username': 'http://axschema.org/namePerson/friendly', 'email': 'http://axschema.org/contact/email', - 'web': 'http://axschema.org/contact/web/default', + #'web': 'http://axschema.org/contact/web/default', #'firstname': 'http://axschema.org/namePerson/first', #'lastname': 'http://axschema.org/namePerson/last', - 'birthdate': 'http://axschema.org/birthDate', + #'birthdate': 'http://axschema.org/birthDate', } def get_user_url(self, request): @@ -107,19 +107,12 @@ class OpenIdAbstractAuthConsumer(AuthenticationConsumer): for n, s in axargs.items() if s in ax_schema2data_type ]) - #available_data = dict([ - # (t, axargs["value.%s.1" % s]) for t, s in available_types.items() - #]) - - #print available_data - - - #email = ax.getExtensionArgs()['value.ext0.1'] - #username = ax.getExtensionArgs()['value.ext0.2'] + available_data = dict([ + (t, axargs["value.%s.1" % s]) for t, s in available_types.items() + ]) request.session['auth_consumer_data'] = { - 'email': '', - 'username': '' + 'email': available_data.get('email', None), } except Exception, e: