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 on Social Connections Page #16

Closed
cademan opened this issue Jun 10, 2011 · 5 comments
Closed

Error on Social Connections Page #16

cademan opened this issue Jun 10, 2011 · 5 comments

Comments

@cademan
Copy link

cademan commented Jun 10, 2011

The page loads fine at first. Then I add a google account connection and receive this error. The error goes away when the google connection is deleted. This error only shows up when twitter login is disabled. Any ideas?

TemplateSyntaxError at /accounts/social/connections/
Caught FieldDoesNotExist while rendering: SocialAccount has no field named 'twitteraccount'

@cademan
Copy link
Author

cademan commented Jun 10, 2011

I forgot to post this as well. The error page highlights this piece of code in the connection.html template for where the error occurs:

{% for base_account in form.accounts %}

@cademan
Copy link
Author

cademan commented Jun 10, 2011

It seems like the error must be occuring in the socailaccount/models.py file in this code:

def get_provider_account(self):
    for f in ['twitteraccount', 'openidaccount', 'facebookaccount']:
        try:
            return getattr(self, f)
        except self._meta.get_field_by_name(f)[0].model.DoesNotExist:
            pass
    assert False

Not sure why it would be raising an exception though as it looks like it should be passing it. I'm a complete python/django noob. I'll fool around with this more when I get home.

@cademan
Copy link
Author

cademan commented Jun 10, 2011

I wonder if the exception can be simplified to just be

except:

??? Have to look when I get home

@cademan
Copy link
Author

cademan commented Jun 10, 2011

changing

 except self._meta.get_field_by_name(f)[0].model.DoesNotExist:

to

except:

worked. It appears that the exception was being caught but it was then raising another exception on get_field_by_name(f)[0]

@cademan cademan closed this as completed Jun 10, 2011
@tijs
Copy link

tijs commented Oct 10, 2011

I think this should be re-opened. Basically when you remove one of the default providers, which should be possible in theory, the template for social connections no longer works. I get the same error when removing the openid app (which i'm not using).

@pennersr pennersr reopened this Oct 12, 2011
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

3 participants