Merge pull request #748 from auto-mat/resolved

Don't show resolved tickets in unassigned tickets list
This commit is contained in:
Garret Wassermann 2019-03-27 14:57:46 -04:00 committed by GitHub
commit eb60b967c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -138,13 +138,15 @@ def dashboard(request):
showing ticket counts by queue/status, and a list of unassigned tickets showing ticket counts by queue/status, and a list of unassigned tickets
with options for them to 'Take' ownership of said tickets. with options for them to 'Take' ownership of said tickets.
""" """
# open & reopened tickets, assigned to current user active_tickets = Ticket.objects.select_related('queue').exclude(
tickets = Ticket.objects.select_related('queue').filter(
assigned_to=request.user,
).exclude(
status__in=[Ticket.CLOSED_STATUS, Ticket.RESOLVED_STATUS], status__in=[Ticket.CLOSED_STATUS, Ticket.RESOLVED_STATUS],
) )
# open & reopened tickets, assigned to current user
tickets = active_tickets.filter(
assigned_to=request.user,
)
# closed & resolved tickets, assigned to current user # closed & resolved tickets, assigned to current user
tickets_closed_resolved = Ticket.objects.select_related('queue').filter( tickets_closed_resolved = Ticket.objects.select_related('queue').filter(
assigned_to=request.user, assigned_to=request.user,
@ -152,11 +154,9 @@ def dashboard(request):
user_queues = _get_user_queues(request.user) user_queues = _get_user_queues(request.user)
unassigned_tickets = Ticket.objects.select_related('queue').filter( unassigned_tickets = active_tickets.filter(
assigned_to__isnull=True, assigned_to__isnull=True,
queue__in=user_queues queue__in=user_queues
).exclude(
status=Ticket.CLOSED_STATUS,
) )
# all tickets, reported by current user # all tickets, reported by current user