From a95fc54586950cbf638e9a2956ee60e8045e1878 Mon Sep 17 00:00:00 2001 From: Ross Poulton Date: Mon, 19 Jan 2009 09:31:24 +0000 Subject: [PATCH] * On the homepage, only redirect to the dashboard if the user is not staff (was redirecting if user was authenticated, although dashboard is for staff-only) (Issue #40) * When editing a ticket, only show staff users in the 'Assign To' drop-down box (Issue #40) --- views/public.py | 2 +- views/staff.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/views/public.py b/views/public.py index d96ee9c4..002ac95f 100644 --- a/views/public.py +++ b/views/public.py @@ -21,7 +21,7 @@ from helpdesk.models import Ticket, Queue def homepage(request): - if request.user.is_authenticated(): + if request.user.is_staff: if getattr(request.user.usersettings.settings, 'login_view_ticketlist', False): return HttpResponseRedirect(reverse('helpdesk_list')) else: diff --git a/views/staff.py b/views/staff.py index 3d4512ea..f8adfb7d 100644 --- a/views/staff.py +++ b/views/staff.py @@ -121,7 +121,7 @@ def view_ticket(request, ticket_id): return render_to_response('helpdesk/ticket.html', RequestContext(request, { 'ticket': ticket, - 'active_users': User.objects.filter(is_active=True, is_staff=True), + 'active_users': User.objects.filter(is_active=True).filter(is_staff=True), 'priorities': Ticket.PRIORITY_CHOICES, 'preset_replies': PreSetReply.objects.filter(Q(queues=ticket.queue) | Q(queues__isnull=True)), }))