Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
611e819d
Commit
611e819d
authored
Oct 24, 2014
by
Will Daly
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change field type for email from 'text' to 'email'
parent
b14a1291
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
4 deletions
+7
-4
common/djangoapps/user_api/helpers.py
+2
-1
common/djangoapps/user_api/tests/test_views.py
+3
-3
common/djangoapps/user_api/views.py
+2
-0
No files found.
common/djangoapps/user_api/helpers.py
View file @
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
=
[
...
...
common/djangoapps/user_api/tests/test_views.py
View file @
611e819d
...
...
@@ -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"
,
...
...
common/djangoapps/user_api/views.py
View file @
611e819d
...
...
@@ -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
=
_
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment