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 %}"
|
||||
ng-controller="{% block ng_controller %}DummyCtrl{% 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 %}"
|
||||
action="{% block form_action %}{% 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 %}
|
||||
<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 %}
|
||||
<fieldset>
|
||||
{% include "horizon/common/_form_fields.html" %}
|
||||
|
@ -28,4 +36,4 @@
|
|||
</form>
|
||||
</div>
|
||||
{% block modal-js %}
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
|
|
|
@ -94,6 +94,7 @@ class CreateUserForm(BaseUserForm):
|
|||
project = forms.DynamicChoiceField(label=_("Primary Project"),
|
||||
add_item_link=ADD_PROJECT_URL)
|
||||
role_id = forms.ChoiceField(label=_("Role"))
|
||||
no_autocomplete = True
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
roles = kwargs.pop('roles')
|
||||
|
@ -171,6 +172,7 @@ class UpdateUserForm(BaseUserForm):
|
|||
widget=forms.PasswordInput(render_value=False),
|
||||
required=False)
|
||||
project = forms.ChoiceField(label=_("Primary Project"))
|
||||
no_autocomplete = True
|
||||
|
||||
def __init__(self, request, *args, **kwargs):
|
||||
super(UpdateUserForm, self).__init__(request, *args, **kwargs)
|
||||
|
|
Loading…
Reference in New Issue