estelam ticket, varizha , others

This commit is contained in:
javad committed 2026-10-13 15:48:24 +03:30
1 parent 35a1ec1794
commit 6b546aad76
71 files changed
+2865 -191

No files matched your search

+4 -1
View File
@@ -12,7 +12,9 @@ from .sharing import staff_message_context
def received_messages(user, ticket=None):
from .dispatch_responses import sealed_message_q
grants = MessageShare.objects.filter(user=user, revoked_at__isnull=True, message__deleted_at__isnull=True)
grants = grants.exclude(sealed_message_q("message__"))
return grants.filter(message__ticket=ticket) if ticket is not None else grants
@@ -28,7 +30,8 @@ def visible_messages(ticket, user):
profile = getattr(user, "staff_profile", None)
if not user.is_active or (profile is not None and not profile.is_active):
raise PermissionDenied
query = ticket.ticket_messages.all()
from .dispatch_responses import filter_response_messages
query = filter_response_messages(ticket.ticket_messages.all(), user)
if TicketPolicy.can_view(user, ticket):
return query
grants = received_messages(user, ticket)