Display open ticket to assignees

This commit is contained in:
cuom1999 2020-10-16 22:48:55 -05:00
parent 0e8b7f51ee
commit 1434b1cbf8

View file

@ -86,7 +86,7 @@ class PostList(ListView):
if self.request.user.is_authenticated: if self.request.user.is_authenticated:
profile = self.request.profile profile = self.request.profile
context['own_open_tickets'] = (Ticket.objects.filter(user=profile, is_open=True).order_by('-id') context['own_open_tickets'] = (Ticket.objects.filter(Q(user=profile) | Q(assignees__in=[profile]), is_open=True).order_by('-id')
.prefetch_related('linked_item').select_related('user__user')) .prefetch_related('linked_item').select_related('user__user'))
else: else:
profile = None profile = None