Get email from facebook

I'm using it like this:

 @login_failed.connect_via(app)
 def on_login_failed(sender, provider, oauth_response):
      cv = get_connection_values_from_oauth_response(provider, oauth_response)
      ds = security.datastore
      user = ds.create_user(display_name=cv.get('display_name', None), email=connection_values.get('email'))
      ds.commit()
      ..

I know it's poor design, if you guide me, I'll write a better solution. Thanks.