Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error of "Connect another account" #17

Open
koorukuroo opened this issue Dec 25, 2015 · 3 comments
Open

Error of "Connect another account" #17

koorukuroo opened this issue Dec 25, 2015 · 3 comments

Comments

@koorukuroo
Copy link

I'm running a example of mongodb.

First, I login a Google.

And try the "Connect another account" with Facebook, Github and Twitter.
But I received the error message.

Could not register: id must be an instance of (str, unicode, ObjectId), not <class 'werkzeug.local.LocalProxy'>
@wooyek
Copy link
Owner

wooyek commented Dec 25, 2015

Can you post a traceback from a development server console?

@koorukuroo
Copy link
Author

2015-12-28 04:28:35,527 INFO    discovery.build - URL being requested: GET https://www.googleapis.com/discovery/v1/apis/plus/v1/rest
2015-12-28 04:28:35,550 INFO    discovery.method - URL being requested: GET https://www.googleapis.com/plus/v1/people/me?alt=json
2015-12-28 04:28:35,841 WARNING core.no_connection - id must be an instance of (str, unicode, ObjectId), not <class 'werkzeug.local.LocalProxy'>
Traceback (most recent call last):
  File "build/bdist.linux-x86_64/egg/flask_social_blueprint/core.py", line 62, in no_connection
    connection = self.create_connection(profile, provider)
  File "build/bdist.linux-x86_64/egg/flask_social_blueprint/core.py", line 84, in create_connection
    return self.connection_adapter.from_profile(current_user, profile)
  File "/home/ubuntu/project/flask-social-blueprint/example/mongodb/auth/models.py", line 119, in from_profile
    connection = cls(user=user, **profile.data)
  File "/home/ubuntu/virtualenv/a/local/lib/python2.7/site-packages/mongoengine/base/document.py", line 85, in __init__
    value = field.to_python(value)
  File "/home/ubuntu/virtualenv/a/local/lib/python2.7/site-packages/mongoengine/fields.py", line 937, in to_python
    value = DBRef(collection, self.document_type.id.to_python(value))
  File "/home/ubuntu/virtualenv/a/local/lib/python2.7/site-packages/mongoengine/base/fields.py", line 392, in to_python
    value = ObjectId(value)
  File "/home/ubuntu/virtualenv/a/local/lib/python2.7/site-packages/bson/objectid.py", line 92, in __init__
    self.__validate(oid)
  File "/home/ubuntu/virtualenv/a/local/lib/python2.7/site-packages/bson/objectid.py", line 203, in __validate
    text_type.__name__, type(oid)))
TypeError: id must be an instance of (str, unicode, ObjectId), not <class 'werkzeug.local.LocalProxy'>
2015-12-28 04:28:35,842 INFO    _internal._log - 112.120.8.53 - - [28/Dec/2015 04:28:35] "GET /_social/callback/Google?code=4/thimwzJk9j3U4yJEXpb1i_orJv1z1FQ HTTP/1.1" 302 -
2015-12-28 04:28:35,945 INFO    _internal._log - 112.120.8.53 - - [28/Dec/2015 04:28:35] "GET / HTTP/1.1" 200 -

@koorukuroo
Copy link
Author

@wooyek I tested your new example for mongodb. It's well work~!
But when I tried "Connect another account", flash message is that
Could not register: Cannot create new user, email [email protected] is already used. Login and then connect external profile.

I can't connect other service id.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants