Skip to content
This repository has been archived by the owner on Aug 23, 2020. It is now read-only.

Registration with Unique Emails #11

Closed
andrewfam opened this issue Jan 29, 2014 · 5 comments
Closed

Registration with Unique Emails #11

andrewfam opened this issue Jan 29, 2014 · 5 comments
Labels

Comments

@andrewfam
Copy link

I've been trying the registration form with unique emails but it is still letting in not unique emails. My urls.py is as below

from registration.forms import RegistrationFormUniqueEmail
from registration.views import RegistrationView

class RegistrationViewUniqueEmail(RegistrationView):
form_class = RegistrationFormUniqueEmail

urlpatterns = patterns('',
url(r'^$','homepage.views.index'),

url(r'^register/$', RegistrationViewUniqueEmail.as_view(), name='registration_register'),
url('^registration/', include('registration.urls')),

)

@lambdalisue
Copy link
Owner

It is because RegistrationView get the form class via function.
https://github.com/lambdalisue/django-inspectional-registration/blob/master/src/registration/views.py#L132

And backend return the form like
https://github.com/lambdalisue/django-inspectional-registration/blob/master/src/registration/backends/default/__init__.py#L284

So you need to make your own registration backend and specify it like

from registration.backend.default import DefaultRegistrationBackend
from registration.forms import RegistrationFormUniqueEmail

class MyRegistrationBackend(DefaultRegistrationBackend):
    def get_registration_form_class(self):
        return RegistrationFormUniqueEmail

# settings.py
REGISTRATION_BACKEND_CLASS = 'path.to.your.backend.MyRegistrationBackend'

Anything else?

@mick-t
Copy link
Contributor

mick-t commented Feb 26, 2016

I think that should be added to the docs as I had a similar problem and found the solution in this issue.

@lambdalisue
Copy link
Owner

Writing English doc. It is always really tough job for me...

@mick-t
Copy link
Contributor

mick-t commented Feb 26, 2016

I'll volunteer! I'll clone the repo and add the instructions and if you
like I can fix any typos or misspellings if you like.

On Fri, Feb 26, 2016 at 12:11 PM, Alisue notifications@github.com wrote:

Writing English doc. It is always really tough job for me...


Reply to this email directly or view it on GitHub
#11 (comment)
.

Mick Timony

Ever tried. Ever failed. No matter. Try Again. Fail again. Fail better. --

S. Beckett

@lambdalisue
Copy link
Owner

I'll volunteer! I'll clone the repo and add the instructions and if you like I can fix any typos or misspellings if you like.

That helps me a lot thanks :-)
I'll add some information about doc in #61 so feel free to ask me :-)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants