Merge "Remove the redundant "required=True""

This commit is contained in:
Jenkins
2017-02-02 15:20:48 +00:00
committed by Gerrit Code Review
6 changed files with 9 additions and 17 deletions
@@ -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 *"),
@@ -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):
+2 -3
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(),
@@ -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(),
@@ -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 = []
@@ -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(),