From 97a7b1eced197ba7be38628ca7dc625f06528fca Mon Sep 17 00:00:00 2001 From: Gael Le Mignot Date: Tue, 25 Jun 2024 13:28:13 +0200 Subject: [PATCH] Added parent and thread identifiers --- .../management/commands/teleforma-get-postman-replies.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/teleforma/management/commands/teleforma-get-postman-replies.py b/teleforma/management/commands/teleforma-get-postman-replies.py index f8588272..c90ebf6b 100644 --- a/teleforma/management/commands/teleforma-get-postman-replies.py +++ b/teleforma/management/commands/teleforma-get-postman-replies.py @@ -113,8 +113,12 @@ class Command(BaseCommand): del lines[-1] body = '\n'.join(lines) - mess = Message(sender=msg.recipient, recipient=msg.sender, - subject=subject, body=body) + if not msg.thread: + msg.thread = msg + + mess = Message(sender = msg.recipient, recipient = msg.sender, + subject = subject, body = body, thread = msg.thread, + parent = msg) mess.moderation_status = 'a' mess.save() site = Site.objects.all()[0] -- 2.39.5