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
be0033ee
Commit
be0033ee
authored
Oct 17, 2014
by
Will Daly
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use password field type for the login form password
parent
c1e26749
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
2 deletions
+4
-2
common/djangoapps/user_api/helpers.py
+2
-1
common/djangoapps/user_api/tests/test_views.py
+1
-1
common/djangoapps/user_api/views.py
+1
-0
No files found.
common/djangoapps/user_api/helpers.py
View file @
be0033ee
...
@@ -94,10 +94,11 @@ class InvalidFieldError(Exception):
...
@@ -94,10 +94,11 @@ class InvalidFieldError(Exception):
class
FormDescription
(
object
):
class
FormDescription
(
object
):
"""Generate a JSON representation of a form. """
"""Generate a JSON representation of a form. """
ALLOWED_TYPES
=
[
"text"
,
"select"
,
"textarea"
,
"checkbox"
]
ALLOWED_TYPES
=
[
"text"
,
"select"
,
"textarea"
,
"checkbox"
,
"password"
]
ALLOWED_RESTRICTIONS
=
{
ALLOWED_RESTRICTIONS
=
{
"text"
:
[
"min_length"
,
"max_length"
],
"text"
:
[
"min_length"
,
"max_length"
],
"password"
:
[
"min_length"
,
"max_length"
],
}
}
def
__init__
(
self
,
method
,
submit_url
):
def
__init__
(
self
,
method
,
submit_url
):
...
...
common/djangoapps/user_api/tests/test_views.py
View file @
be0033ee
...
@@ -596,7 +596,7 @@ class LoginSessionViewTest(ApiTestCase):
...
@@ -596,7 +596,7 @@ class LoginSessionViewTest(ApiTestCase):
{
{
"name"
:
"password"
,
"name"
:
"password"
,
"default"
:
""
,
"default"
:
""
,
"type"
:
"
text
"
,
"type"
:
"
password
"
,
"required"
:
True
,
"required"
:
True
,
"label"
:
"Password"
,
"label"
:
"Password"
,
"placeholder"
:
""
,
"placeholder"
:
""
,
...
...
common/djangoapps/user_api/views.py
View file @
be0033ee
...
@@ -81,6 +81,7 @@ class LoginSessionView(APIView):
...
@@ -81,6 +81,7 @@ class LoginSessionView(APIView):
form_desc
.
add_field
(
form_desc
.
add_field
(
"password"
,
"password"
,
label
=
_
(
u"Password"
),
label
=
_
(
u"Password"
),
field_type
=
"password"
,
restrictions
=
{
restrictions
=
{
"min_length"
:
account_api
.
PASSWORD_MIN_LENGTH
,
"min_length"
:
account_api
.
PASSWORD_MIN_LENGTH
,
"max_length"
:
account_api
.
PASSWORD_MAX_LENGTH
,
"max_length"
:
account_api
.
PASSWORD_MAX_LENGTH
,
...
...
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