def add_openid_simple_registration(request, response, data):
 sreg_data = {}
 sreg_request = sreg.SRegRequest.fromOpenIDRequest(request)
 sreg_fields = sreg_request.allRequestedFields()
 if sreg_fields:
  for field in sreg_fields:
   if ((field == 'email') and ('email' in data)):
    sreg_data['email'] = data['email']
   elif ((field == 'fullname') and ('fullname' in data)):
    sreg_data['fullname'] = data['fullname']
   elif ((field == 'nickname') and ('nickname' in data)):
    sreg_data['nickname'] = data['nickname']
  sreg_response = sreg.SRegResponse.extractResponse(sreg_request, sreg_data)
  sreg_response.toMessage(response.fields)

def add_openid_simple_registration ( request , response , data ) : sreg_data = { } sreg_request = sreg . SRegRequest . fromOpenIDRequest ( request ) sreg_fields = sreg_request . allRequestedFields ( ) if sreg_fields : for field in sreg_fields : if ( ( field == 'email' ) and ( 'email' in data ) ) : sreg_data [ 'email' ] = data [ 'email' ] elif ( ( field == 'fullname' ) and ( 'fullname' in data ) ) : sreg_data [ 'fullname' ] = data [ 'fullname' ] elif ( ( field == 'nickname' ) and ( 'nickname' in data ) ) : sreg_data [ 'nickname' ] = data [ 'nickname' ] sreg_response = sreg . SRegResponse . extractResponse ( sreg_request , sreg_data ) sreg_response . toMessage ( response . fields )
add simple registration fields to the response if requested .