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

NotImplementedError #310

Closed
trikosuave opened this issue Jun 23, 2014 · 5 comments
Closed

NotImplementedError #310

trikosuave opened this issue Jun 23, 2014 · 5 comments

Comments

@trikosuave
Copy link

I am adding Facebook Auth to my django(1.5.8) site. I have set SOCIAL_AUTH_USER_MODEL to our cutsom user. When the pipeline hits the create_user call, it appears to be looking in storage/base.py for user_model which of course raises the NotImplementedError. Shouldn't it use the one in django_app?
Error:
Exception Value:
Implement in subclass
Exception Location: .../lib/python2.7/site-packages/social/storage/base.py in user_model, line 103

Thanks!

@omab
Copy link
Owner

omab commented Jun 24, 2014

That should be the case, could you paste the full traceback? Also, what happens if you try this in a django shell:

from social.apps.django_app.default.models import DjangoStorage

@trikosuave
Copy link
Author

I found an error in a custom function I had in the pipeline. Was able to resolve that.
I couldn't find it in the documentation. I am only using Facebook. Is there a way a user can associate the standard login/user with a Facebook login? Say I manually create a user 'a@example.com' and I want to click a link while logged into 'a' that will associate my facebook login 'b@example.com' to user a. Is there a way to do that? If I try that now (just using social:begin url) while logged in as 'a', I get this:
ValueError at /complete/facebook/
Cannot assign "<django.utils.functional.SimpleLazyObject object at 0x114b20c10>": "UserSocialAuth.user" must be a "UserProfile" instance.
I am using django 1.5
Thanks!

@omab
Copy link
Owner

omab commented Jun 24, 2014

Social association to logged in users is totally possible and /login/facebook/ (social:begin URL) is the way to do it, but the error you get is because something else, you have AUTH_USER_MODEL or SOCIAL_AUTH_USER_MODEL defined? Is it pointing to a User model or a UserProfile model?

@trikosuave
Copy link
Author

Thanks. Had to work my way around our custom User model. However, when i login to facebook as user b when logged into our site as user a, it creates and logs me in to user b and doesnt associate with user a at all. Logging into facebook (user b) should log me into the site as user a. however it logs me in as b. Is there a setting I am missing?

@trikosuave
Copy link
Author

I am going to close this issue as mine is more in the implementation than an issue with the code itself. Thanks for your help. I am still having trouble but will post on https://groups.google.com/forum/#!forum/python-social-auth instead. Thanks!

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