EmailAddress not really required in DisconnectForm #61

Closed
metawake opened this Issue Jun 5, 2012 · 3 comments

Comments

Projects
None yet
2 participants

metawake commented Jun 5, 2012

I was using django-allauth for an existing website for only connecting/disconnecting to accounts.
But while disconnecting FB account, the error message said that account is not connected to EmailAddress.
I don't think I need EmailAddress because I am using my custom authentication to log in.
I've commented out that line and the django-allauth continued to behave decently.
I suggest that we introduce a setting(boolean value) that makes that line in socialaccount/forms.py/DisconnectForm/clean() optional.
E.g.

if settings.USE_EMAIL_ADDRESS and EmailAddress.objects.filter(user=self.user,
verified=True).count() == 0:
raise forms.ValidationError(_("Your local account has no verified e-mail address."))

Do you think it could be worth pull request?

Owner

pennersr commented Jun 5, 2012

I feel that a setting is not sufficient if the goal is to provide full support for hooking allauth.socialaccount up to a custom authentication mechanism. Probably, something akin to a pluggable adapter class wrapping the local account business logic would be the way to go. Then, the code that you listed could be moved into the adapter, making it overridable for user specific use cases.

I'll leave the ticket open for now, but I must admit this use case is something for a more long term roadmap, not something for the near future...

Owner

pennersr commented Feb 12, 2013

Separating the socialaccount from the account app is not something I'll be working on, nor do I see this being implemented as a clean patch any time soon. Therefore, I'll close the issue.

@pennersr pennersr closed this Feb 12, 2013

Owner

pennersr commented May 30, 2013

The account disconnect logic has now been moved to the adapter (6859611)...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment