From d161dc973531ee0eee950f9b9c3fb43bc82efdd0 Mon Sep 17 00:00:00 2001 From: Magnus Hagander Date: Fri, 4 Jan 2019 13:44:16 +0100 Subject: [PATCH] Fix variable reference in thread API This should never have worked, but as the old python version would leak the last message in the previous loop, it did work. As all messages have the same threadid (when they're on teh same thread), just us the one in the known-existing message instead. --- django/archives/mailarchives/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django/archives/mailarchives/api.py b/django/archives/mailarchives/api.py index b53e08e..c0bced3 100644 --- a/django/archives/mailarchives/api.py +++ b/django/archives/mailarchives/api.py @@ -112,7 +112,7 @@ def thread(request, msgid): 'atts': [{'id': a.id, 'name': a.filename} for a in m.attachment_set.all()], } for m in mlist], resp) - resp['X-pgthread'] = m.threadid + resp['X-pgthread'] = msg.threadid return resp -- 2.39.5