Commit 56d55608 by Will Daly

Merge pull request #5714 from edx/will/logistration-email-field

Change field type for email from 'text' to 'email'
parents b14a1291 611e819d
......@@ -95,11 +95,12 @@ class InvalidFieldError(Exception):
class FormDescription(object):
"""Generate a JSON representation of a form. """
ALLOWED_TYPES = ["text", "select", "textarea", "checkbox", "password"]
ALLOWED_TYPES = ["text", "email", "select", "textarea", "checkbox", "password"]
ALLOWED_RESTRICTIONS = {
"text": ["min_length", "max_length"],
"password": ["min_length", "max_length"],
"email": ["min_length", "max_length"],
}
OVERRIDE_FIELD_PROPERTIES = [
......
......@@ -600,7 +600,7 @@ class LoginSessionViewTest(ApiTestCase):
{
"name": "email",
"defaultValue": "",
"type": "text",
"type": "email",
"required": True,
"label": "E-mail",
"placeholder": "example: username@domain.com",
......@@ -763,7 +763,7 @@ class RegistrationViewTest(ApiTestCase):
{
u"name": u"email",
u"defaultValue": u"",
u"type": u"text",
u"type": u"email",
u"required": True,
u"label": u"E-mail",
u"placeholder": u"example: username@domain.com",
......@@ -854,7 +854,7 @@ class RegistrationViewTest(ApiTestCase):
{
u"name": u"email",
u"defaultValue": u"bob@example.com",
u"type": u"text",
u"type": u"email",
u"required": True,
u"label": u"E-mail",
u"placeholder": u"example: username@domain.com",
......
......@@ -75,6 +75,7 @@ class LoginSessionView(APIView):
form_desc.add_field(
"email",
field_type="email",
label=_(u"E-mail"),
placeholder=_(u"example: username@domain.com"),
instructions=_(
......@@ -252,6 +253,7 @@ class RegistrationView(APIView):
def _add_email_field(self, form_desc, required=True):
form_desc.add_field(
"email",
field_type="email",
label=_(u"E-mail"),
placeholder=_(u"example: username@domain.com"),
instructions=_(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment