aboutsummaryrefslogtreecommitdiffstats
path: root/src/booking
diff options
context:
space:
mode:
authorSawyer Bergeron <sbergeron@iol.unh.edu>2021-04-07 15:20:07 +0000
committerGerrit Code Review <gerrit@opnfv.org>2021-04-07 15:20:07 +0000
commit593ea6dc98ab12c1e70d65b16103f92f8b17abbc (patch)
treee3acf0991d160bf5dbee59ccc7b648bd7a2629a5 /src/booking
parent241ff304980c8bf542fdd1a2a47f73accf912ee1 (diff)
parent2271036232bce7ce4f2136ee6e031e9e77d9c1c2 (diff)
Merge "Restrict image on multi-node booking"
Diffstat (limited to 'src/booking')
-rw-r--r--src/booking/forms.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/booking/forms.py b/src/booking/forms.py
index 9cec35d..cbc3407 100644
--- a/src/booking/forms.py
+++ b/src/booking/forms.py
@@ -35,10 +35,18 @@ class QuickBookingForm(forms.Form):
super(QuickBookingForm, self).__init__(data=data, **kwargs)
+ image_help_text = 'Image can be set only for single-node bookings. For multi-node bookings set image through Design a POD.'
self.fields["image"] = forms.ModelChoiceField(
Image.objects.filter(public=True) | Image.objects.filter(owner=user), required=False
)
+ self.fields['image'].widget.attrs.update({
+ 'class': 'has-popover',
+ 'data-content': image_help_text,
+ 'data-placement': 'bottom',
+ 'data-container': 'body'
+ })
+
self.fields['users'] = SearchableSelectMultipleField(
queryset=UserProfile.objects.filter(public_user=True).select_related('user').exclude(user=user),
items=get_user_items(exclude=user),
@@ -59,10 +67,10 @@ class QuickBookingForm(forms.Form):
self.fields['filter_field'] = MultipleSelectFilterField(widget=MultipleSelectFilterWidget(**lab_data))
- help_text = 'Hostname can be set only for single-node bookings. For multi-node bookings set hostname through Design a POD.'
+ hostname_help_text = 'Hostname can be set only for single-node bookings. For multi-node bookings set hostname through Design a POD.'
self.fields['hostname'].widget.attrs.update({
'class': 'has-popover',
- 'data-content': help_text,
+ 'data-content': hostname_help_text,
'data-placement': 'top',
'data-container': 'body'
})