diff options
Diffstat (limited to 'src/booking')
-rw-r--r-- | src/booking/forms.py | 14 | ||||
-rw-r--r-- | src/booking/lib.py | 2 |
2 files changed, 12 insertions, 4 deletions
diff --git a/src/booking/forms.py b/src/booking/forms.py index e7be70f..cbc3407 100644 --- a/src/booking/forms.py +++ b/src/booking/forms.py @@ -35,12 +35,20 @@ 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.select_related('user').exclude(user=user), + queryset=UserProfile.objects.filter(public_user=True).select_related('user').exclude(user=user), items=get_user_items(exclude=user), required=False, **get_user_field_opts() @@ -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' }) diff --git a/src/booking/lib.py b/src/booking/lib.py index 8132c75..7a4c261 100644 --- a/src/booking/lib.py +++ b/src/booking/lib.py @@ -23,7 +23,7 @@ def get_user_field_opts(): def get_user_items(exclude=None): - qs = UserProfile.objects.select_related('user').exclude(user=exclude) + qs = UserProfile.objects.filter(public_user=True).select_related('user').exclude(user=exclude) items = {} for up in qs: item = { |