Ticket-reply notification receiver skips raw saves (loaddata made 5 duplicate notifications)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -13,8 +13,9 @@ from .models import TicketMessage
|
||||
|
||||
|
||||
@receiver(post_save, sender=TicketMessage, dispatch_uid='support_notify_ticket_reply')
|
||||
def _notify_ticket_reply(sender, instance, created, **kwargs):
|
||||
if not created or instance.sender != 'support':
|
||||
def _notify_ticket_reply(sender, instance, created, raw=False, **kwargs):
|
||||
# raw=True: loaddata (انتقال به Postgres)؛ اعلانِ آن پیامها خودش در فایل است و اینجا دوباره ساخته میشد.
|
||||
if raw or not created or instance.sender != 'support':
|
||||
return
|
||||
from notifications.services import notify
|
||||
|
||||
|
||||
Reference in New Issue
Block a user