summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2017-12-01 02:22:54 +0000
committerGerrit Code Review <review@openstack.org>2017-12-01 02:22:54 +0000
commit83e8197867a534d9e8ee282360962a2fac489e93 (patch)
treeecc328fce68680f0e11d9342e2fd4378815acb9b
parent71a849b9600df7afb0792c77d5170abb469e83fc (diff)
parentbb4f3ffc4b07fd1dc07a09360665d8dc93925f3e (diff)
Merge "Make create env show the correct error message"
-rw-r--r--muranodashboard/environments/forms.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/muranodashboard/environments/forms.py b/muranodashboard/environments/forms.py
index d6bf71d..0f50843 100644
--- a/muranodashboard/environments/forms.py
+++ b/muranodashboard/environments/forms.py
@@ -67,12 +67,12 @@ class CreateEnvironmentForm(horizon_forms.SelfHandlingForm):
67 self.fields['net_config'].choices = net_choices 67 self.fields['net_config'].choices = net_choices
68 self.fields['net_config'].help_text = help_text 68 self.fields['net_config'].help_text = help_text
69 69
70 def clean_name(self): 70 def clean(self):
71 cleaned_data = super(CreateEnvironmentForm, self).clean() 71 cleaned_data = super(CreateEnvironmentForm, self).clean()
72 env_name = cleaned_data.get('name') 72 env_name = cleaned_data.get('name')
73 if not env_name.strip(): 73 if not env_name or not env_name.strip():
74 self._errors['name'] = self.error_class([ENV_NAME_HELP_TEXT]) 74 self._errors['name'] = self.error_class([ENV_NAME_HELP_TEXT])
75 return env_name 75 return cleaned_data
76 76
77 def handle(self, request, data): 77 def handle(self, request, data):
78 try: 78 try: