]> git.parisson.com Git - teleforma.git/commitdiff
Added parent and thread identifiers
authorGael Le Mignot <gael@pilotsystems.net>
Tue, 25 Jun 2024 11:28:13 +0000 (13:28 +0200)
committerGael Le Mignot <gael@pilotsystems.net>
Tue, 25 Jun 2024 11:28:13 +0000 (13:28 +0200)
teleforma/management/commands/teleforma-get-postman-replies.py

index f858827204b94b3e9c07c5f4a5fa1fd6f5974fca..c90ebf6b2de4dfb33d52b9ed8d7ed008a2b1f446 100644 (file)
@@ -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]