3

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

ruskin
  • 469
  • 9
  • 17

1 Answers1

2

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.

Abid A
  • 7,588
  • 4
  • 32
  • 32
  • Its not working for me. I tried the above code as well as tried by return RegistrationFormUniqueEmail() in __init__.py in backends – ruskin Feb 02 '11 at 19:20