Remove the redundant "required=True"

The django form field default is "required=True", so this patch
remove the redundant "required=True" in the form.

Change-Id: I3d91ae0638b69d56c1f1b72913ee4995db249007
This commit is contained in:
Qian Min Chen 2018-07-19 16:53:40 +08:00
parent e4e11455a6
commit 2fa872aac2
4 changed files with 5 additions and 8 deletions

View File

@ -212,7 +212,7 @@ class Column(html.HTMLElement):
A form field used for inline editing of the column. A django
forms.Field can be used or django form.Widget can be used.
Example: ``form_field=forms.CharField(required=True)``.
Example: ``form_field=forms.CharField()``.
Defaults to ``None``.
.. attribute:: form_field_attributes

View File

@ -134,7 +134,7 @@ class IPFieldTests(test.TestCase):
"1111:2222::4444:5555:6666::8888",
"1111:2222::4444:5555:6666:8888/",
"1111:2222::4444:5555:6666::8888/130")
ipv4 = forms.IPField(required=True, version=forms.IPv4)
ipv4 = forms.IPField(version=forms.IPv4)
ipv6 = forms.IPField(required=False, version=forms.IPv6)
ipmixed = forms.IPField(required=False,
version=forms.IPv4 | forms.IPv6)

View File

@ -274,7 +274,7 @@ class MyTable(tables.DataTable):
name = tables.Column(get_name,
verbose_name="Verbose Name",
sortable=True,
form_field=forms.CharField(required=True),
form_field=forms.CharField(),
form_field_attributes={'class': 'test'})
value = tables.Column('value',
sortable=True,
@ -334,7 +334,7 @@ class MyTableNotAllowedInlineEdit(MyTable):
name = tables.Column(get_name,
verbose_name="Verbose Name",
sortable=True,
form_field=forms.CharField(required=True),
form_field=forms.CharField(),
form_field_attributes={'class': 'test'})
class Meta(object):
@ -345,7 +345,7 @@ class MyTableNotAllowedInlineEdit(MyTable):
class MyTableWrapList(MyTable):
name = tables.Column('name',
form_field=forms.CharField(required=True),
form_field=forms.CharField(),
form_field_attributes={'class': 'test'},
wrap_list=True)
value = tables.Column('value',
@ -721,7 +721,6 @@ class DataTableTests(test.TestCase):
verbose_name="Verbose Name",
sortable=True,
form_field=forms.BooleanField(
required=True,
label="Verbose Name"),
form_field_attributes={'class': 'test'})

View File

@ -68,7 +68,6 @@ class Login(django_auth_forms.AuthenticationForm):
self.fields['domain'] = forms.ChoiceField(
label=_("Domain"),
initial=last_domain,
required=True,
choices=getattr(settings,
'OPENSTACK_KEYSTONE_DOMAIN_CHOICES',
()))
@ -76,7 +75,6 @@ class Login(django_auth_forms.AuthenticationForm):
self.fields['domain'] = forms.CharField(
initial=last_domain,
label=_("Domain"),
required=True,
widget=forms.TextInput(attrs={"autofocus": "autofocus"}))
self.fields['username'].widget = forms.widgets.TextInput()
fields_ordering = ['domain', 'username', 'password', 'region']