From 5fdc1402ccbb1dcdc683682613414ff1be0bcb6e Mon Sep 17 00:00:00 2001 From: Eddie Ramirez Date: Tue, 3 May 2016 20:56:38 +0000 Subject: [PATCH] Edit Extra Spec Value Fail This patch fixes the modal-header content when the form is invalid. A wrong message was shown when the user didn't provide a valid value for this form. Change-Id: I6de361ad3a602329abd7b09c485bd4c4fd7d5a76 Closes-bug: #1570488 --- .../dashboards/admin/volumes/volume_types/extras/views.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/openstack_dashboard/dashboards/admin/volumes/volume_types/extras/views.py b/openstack_dashboard/dashboards/admin/volumes/volume_types/extras/views.py index b8afe05fa4..c77218566a 100644 --- a/openstack_dashboard/dashboards/admin/volumes/volume_types/extras/views.py +++ b/openstack_dashboard/dashboards/admin/volumes/volume_types/extras/views.py @@ -119,3 +119,10 @@ class EditView(ExtraSpecMixin, forms.ModalFormView): context['submit_url'] = reverse(self.submit_url, args=args) context['modal_header'] = self.modal_header % self.kwargs['key'] return context + + def form_invalid(self, form): + context = super(EditView, self).get_context_data() + context = self._populate_context(context) + context['form'] = form + context['modal_header'] = self.modal_header % self.kwargs['key'] + return self.render_to_response(context)