From aeaae9fdb0e3d227b24d7a398fb257f434d6c66e Mon Sep 17 00:00:00 2001 From: Zhenguo Niu Date: Fri, 21 Feb 2014 14:56:14 +0800 Subject: [PATCH] Remove volume source option on some dialogs When creating a volume from snapshot or image, volume source option should not be displayed. Change-Id: I27d1a8e23b3ccf6c57922309bddf28dc9a76bab7 Closes-Bug: #1282845 --- openstack_dashboard/dashboards/project/volumes/volumes/forms.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openstack_dashboard/dashboards/project/volumes/volumes/forms.py b/openstack_dashboard/dashboards/project/volumes/volumes/forms.py index fea238f9ee..44929f093f 100644 --- a/openstack_dashboard/dashboards/project/volumes/volumes/forms.py +++ b/openstack_dashboard/dashboards/project/volumes/volumes/forms.py @@ -109,6 +109,7 @@ class CreateForm(forms.SelfHandlingForm): 'to or greater than the snapshot size (%sGB)') \ % snapshot.size del self.fields['image_source'] + del self.fields['volume_source'] del self.fields['volume_source_type'] del self.fields['availability_zone'] except Exception: @@ -138,6 +139,7 @@ class CreateForm(forms.SelfHandlingForm): self.fields['size'].help_text = size_help_text self.fields['image_source'].choices = ((image.id, image),) del self.fields['snapshot_source'] + del self.fields['volume_source'] del self.fields['volume_source_type'] except Exception: msg = _('Unable to load the specified image. %s')