ruskin
ruskin

Reputation: 479

django registration - allows multiple users for an email id

I am trying out django-registration. I found that it allows multiple registration for same emailid. I want to prevent that. What is the best way to do that?

ok, I see there is a subclass RegistrationFormUniqueEmail. Now, how to use this class? I changed this

    def get_form_class(self, request):

    return RegistrationFormUniqueEmail

But, it must be better to change this from my application rather than in source code. So, how do I do that? thanks

Upvotes: 3

Views: 614

Answers (1)

Abid A
Abid A

Reputation: 7858

Once you've added registration to your settings file, you can use the form in your views.py like so:

from registration.forms import RegistrationFormUniqueEmail

form = RegistrationFormUniqueEmail()

That's it. That will give you the form that you need and will take care of the unique email validation.

Upvotes: 2

Related Questions