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: Id2342cea882134099a43f2149e7b56168a015afe
This commit is contained in:
qiaomin 2017-01-26 23:15:30 +08:00
parent df797b87dd
commit ac7908c15e
6 changed files with 9 additions and 17 deletions

View File

@ -32,16 +32,14 @@ class ActionConfigurationAction(workflows.Action):
required=False)
action = forms.ChoiceField(
help_text=_("Set the action to be taken"),
required=True)
help_text=_("Set the action to be taken"))
mode = forms.ChoiceField(
help_text=_("Choose what you want to backup"),
required=False)
storage = forms.ChoiceField(
help_text=_("Set storage backend for a backup"),
required=True)
help_text=_("Set storage backend for a backup"))
mysql_conf = forms.CharField(
label=_("MySQL Configuration File *"),

View File

@ -25,8 +25,7 @@ import disaster_recovery.api.api as freezer_api
class DestinationAction(workflows.MembershipAction):
path = forms.CharField(label=_("Destination Path"),
help_text=_("The path in which the backup should be"
" restored"),
required=True)
" restored"))
backup_id = forms.CharField(widget=forms.HiddenInput())
def clean(self):

View File

@ -62,7 +62,7 @@ class ClientsConfigurationAction(workflows.MembershipAction):
field_name = self.get_member_field_name('member')
if not job_id:
self.fields[field_name] = forms.MultipleChoiceField(required=True)
self.fields[field_name] = forms.MultipleChoiceField()
self.fields[field_name].choices = client_list
class Meta:
@ -96,8 +96,7 @@ class InfoConfigurationAction(workflows.Action):
description = forms.CharField(
label=_("Job Name"),
help_text=_("Set a name for this job"),
required=True)
help_text=_("Set a name for this job"))
job_id = forms.CharField(
widget=forms.HiddenInput(),

View File

@ -28,8 +28,7 @@ class InfoConfigurationAction(workflows.Action):
description = forms.CharField(
label=_("Job Name"),
help_text=_("Set a name for this job"),
required=True)
help_text=_("Set a name for this job"))
job_id = forms.CharField(
widget=forms.HiddenInput(),

View File

@ -25,12 +25,10 @@ import disaster_recovery.api.api as freezer_api
class SessionConfigurationAction(workflows.Action):
session_id = forms.ChoiceField(
help_text=_("Set a session to attach this job"),
label=_("Session Name"),
required=True)
label=_("Session Name"))
job_id = forms.CharField(
widget=forms.HiddenInput(),
required=True)
widget=forms.HiddenInput())
def populate_session_id_choices(self, request, context):
sessions = []

View File

@ -28,8 +28,7 @@ import disaster_recovery.api.api as freezer_api
class SessionConfigurationAction(workflows.Action):
description = forms.CharField(
label=_("Session Name"),
help_text=_("Define a name for this session"),
required=True)
help_text=_("Define a name for this session"))
session_id = forms.CharField(
widget=forms.HiddenInput(),