注册表唯一电子邮件 [英] Registration Form Unique Email

查看:88
本文介绍了注册表唯一电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是 django-inspectional-registration ,它基于官方的 django-registration

I am using django-inspectional-registration which is based on the official django-registration.

我想确保用户电子邮件字段的唯一性,但是我在使用时:

I would like to ensure the uniqueness of the User's email field but I while I am using:

url(r'^register/$', RegistrationView.as_view(), {'form_class' : RegistrationFormUniqueEmail},
    name='registration_register'),

如建议的那样,使用相同电子邮件进行的新注册始终会通过验证。

as suggested, a new registration with the same email always pass the verification.

任何

推荐答案

尝试将表单类作为参数传递给as_view

Try passing the form class as an argument to as_view

url(r'^register/$', RegistrationView.as_view(form_class=RegistrationFormUniqueEmail),
name='registration_register')

这篇关于注册表唯一电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆