diff --git a/osinaweb/customercore/__pycache__/custom_context.cpython-310.pyc b/osinaweb/customercore/__pycache__/custom_context.cpython-310.pyc index d68fe36a..ffca7fb2 100644 Binary files a/osinaweb/customercore/__pycache__/custom_context.cpython-310.pyc and b/osinaweb/customercore/__pycache__/custom_context.cpython-310.pyc differ diff --git a/osinaweb/customercore/__pycache__/views.cpython-310.pyc b/osinaweb/customercore/__pycache__/views.cpython-310.pyc index e929f8e3..1de9fe25 100644 Binary files a/osinaweb/customercore/__pycache__/views.cpython-310.pyc and b/osinaweb/customercore/__pycache__/views.cpython-310.pyc differ diff --git a/osinaweb/customercore/custom_context.py b/osinaweb/customercore/custom_context.py index e7db1aac..8e76a44a 100644 --- a/osinaweb/customercore/custom_context.py +++ b/osinaweb/customercore/custom_context.py @@ -15,7 +15,7 @@ def utilities(request): for ticket in customer_open_tickets: unread_updates_count = 0 - for ticket_update in ticket.ticketupdate_set.all(): + for ticket_update in ticket.ticketupdate_set.exclude(added_by=request.user): if not TicketRead.objects.filter(ticket_update=ticket_update, user=request.user, read=True).exists(): unread_updates_count += 1 ticket.unread_updates_count = unread_updates_count diff --git a/osinaweb/customercore/views.py b/osinaweb/customercore/views.py index eea676a6..8536fe31 100644 --- a/osinaweb/customercore/views.py +++ b/osinaweb/customercore/views.py @@ -171,10 +171,9 @@ def customer_tickets(request, *args, **kwargs): def customer_ticket_details(request, ticket_number): ticket = get_object_or_404(Ticket, ticket_number=ticket_number) ticket_updates = TicketUpdate.objects.filter(ticket=ticket).order_by('id') - for update in ticket_updates: + for update in TicketUpdate.objects.filter(ticket=ticket).exclude(added_by=request.user).order_by('id'): if not TicketRead.objects.filter(ticket_update=update, user=request.user).exists(): TicketRead.objects.create(ticket_update=update, user=request.user, read=True) - context = { 'ticket': ticket, 'ticket_updates': ticket_updates, diff --git a/osinaweb/db.sqlite3 b/osinaweb/db.sqlite3 index e366fcb3..9ff7b1b8 100644 Binary files a/osinaweb/db.sqlite3 and b/osinaweb/db.sqlite3 differ