Merge "Allow forms to disable autofill in all browsers" into stable/icehouse
This commit is contained in:
commit
9ad9af4b8d
|
@ -12,12 +12,20 @@
|
||||||
<form id="{% block form_id %}{% endblock %}"
|
<form id="{% block form_id %}{% endblock %}"
|
||||||
ng-controller="{% block ng_controller %}DummyCtrl{% endblock %}"
|
ng-controller="{% block ng_controller %}DummyCtrl{% endblock %}"
|
||||||
name="{% block form_name %}{% endblock %}"
|
name="{% block form_name %}{% endblock %}"
|
||||||
autocomplete="{% block autocomplete %}{% endblock %}"
|
autocomplete="{% block autocomplete %}{% if form.no_autocomplete %}off{% endif %}{% endblock %}"
|
||||||
class="{% block form_class %}{% endblock %}"
|
class="{% block form_class %}{% endblock %}"
|
||||||
action="{% block form_action %}{% endblock %}"
|
action="{% block form_action %}{% endblock %}"
|
||||||
method="{% block form-method %}POST{% endblock %}"
|
method="{% block form-method %}POST{% endblock %}"
|
||||||
{% if add_to_field %}data-add-to-field="{{ add_to_field }}"{% endif %} {% block form_attrs %}{% endblock %}>{% csrf_token %}
|
{% if add_to_field %}data-add-to-field="{{ add_to_field }}"{% endif %} {% block form_attrs %}{% endblock %}>{% csrf_token %}
|
||||||
<div class="modal-body clearfix">
|
<div class="modal-body clearfix">
|
||||||
|
|
||||||
|
{% comment %}
|
||||||
|
These fake fields are required to prevent Chrome v34+ from autofilling form.
|
||||||
|
{% endcomment %}
|
||||||
|
{% if form.no_autocomplete %}
|
||||||
|
<input type="text" name="fake_email" value="" style="display: none" />
|
||||||
|
<input type="password" name="fake_password" value="" style="display: none" />
|
||||||
|
{% endif %}
|
||||||
{% block modal-body %}
|
{% block modal-body %}
|
||||||
<fieldset>
|
<fieldset>
|
||||||
{% include "horizon/common/_form_fields.html" %}
|
{% include "horizon/common/_form_fields.html" %}
|
||||||
|
|
|
@ -94,6 +94,7 @@ class CreateUserForm(BaseUserForm):
|
||||||
project = forms.DynamicChoiceField(label=_("Primary Project"),
|
project = forms.DynamicChoiceField(label=_("Primary Project"),
|
||||||
add_item_link=ADD_PROJECT_URL)
|
add_item_link=ADD_PROJECT_URL)
|
||||||
role_id = forms.ChoiceField(label=_("Role"))
|
role_id = forms.ChoiceField(label=_("Role"))
|
||||||
|
no_autocomplete = True
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
roles = kwargs.pop('roles')
|
roles = kwargs.pop('roles')
|
||||||
|
@ -171,6 +172,7 @@ class UpdateUserForm(BaseUserForm):
|
||||||
widget=forms.PasswordInput(render_value=False),
|
widget=forms.PasswordInput(render_value=False),
|
||||||
required=False)
|
required=False)
|
||||||
project = forms.ChoiceField(label=_("Primary Project"))
|
project = forms.ChoiceField(label=_("Primary Project"))
|
||||||
|
no_autocomplete = True
|
||||||
|
|
||||||
def __init__(self, request, *args, **kwargs):
|
def __init__(self, request, *args, **kwargs):
|
||||||
super(UpdateUserForm, self).__init__(request, *args, **kwargs)
|
super(UpdateUserForm, self).__init__(request, *args, **kwargs)
|
||||||
|
|
Loading…
Reference in New Issue