<s> import urlparse <EOL> from openid import oidutil <EOL> from django . conf import settings <EOL> from django . core . urlresolvers import reverse <EOL> from django . http import HttpResponseRedirect <EOL> from django . template import RequestContext <EOL> from django . shortcuts import render_to_response <EOL> from django_openid . registration import RegistrationConsumer <EOL> from account . forms import OpenIDSignupForm <EOL> from account . utils import get_default_redirect <EOL> from account . views import login as account_login <EOL> def dummy_log ( * args , ** kwargs ) : <EOL> return <EOL> oidutil . log = dummy_log <EOL> class PinaxConsumer ( RegistrationConsumer ) : <EOL> confirm_email_addresses = False <EOL> def on_registration_complete ( self , request ) : <EOL> return HttpResponseRedirect ( get_default_redirect ( request ) ) <EOL> def show_i_have_logged_you_in ( self , request ) : <EOL> return HttpResponseRedirect ( get_default_redirect ( request ) ) <EOL> def get_registration_form_class ( self , request ) : <EOL> return OpenIDSignupForm <EOL> def do_register ( self , request , * args , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> openid_url = request . POST . get ( "<STR_LIT>" ) <EOL> openids = request . session . get ( "<STR_LIT>" ) <EOL> if not openid_url and not openids : <EOL> return account_login ( request , url_required = True , extra_context = { <EOL> "<STR_LIT>" : True , <EOL> } ) <EOL> if openid_url : <EOL> return self . start_openid_process ( request , <EOL> user_url = openid_url , <EOL> on_complete_url = urlparse . urljoin ( <EOL> request . path , "<STR_LIT>" <EOL> ) , <EOL> trust_root = urlparse . urljoin ( request . path , "<STR_LIT:..>" ) <EOL> ) <EOL> if not settings . ACCOUNT_OPEN_SIGNUP : <EOL> return render_to_response ( "<STR_LIT>" , { <EOL> } , context_instance = RequestContext ( request ) ) <EOL> return super ( PinaxConsumer , self ) . do_register ( request , * args , ** kwargs ) <EOL> def show_already_signed_in ( self , request ) : <EOL> return render_to_response ( "<STR_LIT>" , { <EOL> } , context_instance = RequestContext ( request ) ) </s>
