Commit be0033ee by Will Daly

Use password field type for the login form password

parent c1e26749
......@@ -94,10 +94,11 @@ class InvalidFieldError(Exception):
class FormDescription(object):
"""Generate a JSON representation of a form. """
ALLOWED_TYPES = ["text", "select", "textarea", "checkbox"]
ALLOWED_TYPES = ["text", "select", "textarea", "checkbox", "password"]
ALLOWED_RESTRICTIONS = {
"text": ["min_length", "max_length"],
"password": ["min_length", "max_length"],
}
def __init__(self, method, submit_url):
......
......@@ -596,7 +596,7 @@ class LoginSessionViewTest(ApiTestCase):
{
"name": "password",
"default": "",
"type": "text",
"type": "password",
"required": True,
"label": "Password",
"placeholder": "",
......
......@@ -81,6 +81,7 @@ class LoginSessionView(APIView):
form_desc.add_field(
"password",
label=_(u"Password"),
field_type="password",
restrictions={
"min_length": account_api.PASSWORD_MIN_LENGTH,
"max_length": account_api.PASSWORD_MAX_LENGTH,
......
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