From ba3852df7a69a1a25dd366fd3657fce3740cf23f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?C=C3=A9lestin=20Matte?= <gitlab@cmatte.me>
Date: Mon, 25 Oct 2021 16:42:49 +0200
Subject: [PATCH] Bugfix: allow message's parentid to be null

Otherwise, load_message.py will crash upon creation of a new thread
---
 django/archives/mailarchives/models.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/django/archives/mailarchives/models.py b/django/archives/mailarchives/models.py
index 44c4469..879d280 100644
--- a/django/archives/mailarchives/models.py
+++ b/django/archives/mailarchives/models.py
@@ -25,7 +25,7 @@ class Message(models.Model):
     messageid = models.TextField(null=False)
     bodytxt = models.TextField(null=False)
     # rawtxt is a bytea field, which django doesn't support (easily)
-    parentid = models.IntegerField(null=False, blank=False)
+    parentid = models.IntegerField(null=True, blank=False)
     has_attachment = models.BooleanField(null=False, default=False)
     hiddenstatus = models.IntegerField(null=True)
     # fti is a tsvector field, which django doesn't support (easily)
-- 
2.33.1

