display list of queues only for users with right permissions

This commit is contained in:
Jachym Cepicky
2019-02-05 14:38:41 +01:00
parent 305d669e71
commit 8cc0ca47f8
3 changed files with 48 additions and 5 deletions

View File

@ -275,8 +275,11 @@ class TicketForm(AbstractTicketForm):
"""
Add any custom fields that are defined to the form.
"""
queue_choices = kwargs.pop("queue_choices")
super().__init__(*args, **kwargs)
self.fields['queue'].choices = [('', '--------')] + [(q.id, q.title) for q in Queue.objects.all()]
self.fields['queue'].choices = queue_choices
if helpdesk_settings.HELPDESK_STAFF_ONLY_TICKET_OWNERS:
assignable_users = User.objects.filter(is_active=True, is_staff=True).order_by(User.USERNAME_FIELD)
else: