diff options
Diffstat (limited to 'pgcommitfest/commitfest/ajax.py')
-rw-r--r-- | pgcommitfest/commitfest/ajax.py | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/pgcommitfest/commitfest/ajax.py b/pgcommitfest/commitfest/ajax.py index 9d53e53..08d86a2 100644 --- a/pgcommitfest/commitfest/ajax.py +++ b/pgcommitfest/commitfest/ajax.py @@ -106,23 +106,23 @@ def doAttachThread(cf, patch, msgid, user): thread.latestsubject=r[-1]['subj'] thread.latestmsgid=r[-1]['msgid'] thread.save() - return True - - # No existing thread existed, so create it - # Now create a new mailthread entry - m = MailThread(messageid=r[0]['msgid'], - subject=r[0]['subj'], - firstmessage=r[0]['date'], - firstauthor=r[0]['from'], - latestmessage=r[-1]['date'], - latestauthor=r[-1]['from'], - latestsubject=r[-1]['subj'], - latestmsgid=r[-1]['msgid'], - ) - m.save() - m.patches.add(patch) - m.save() - parse_and_add_attachments(r, m) + else: + # No existing thread existed, so create it + # Now create a new mailthread entry + m = MailThread(messageid=r[0]['msgid'], + subject=r[0]['subj'], + firstmessage=r[0]['date'], + firstauthor=r[0]['from'], + latestmessage=r[-1]['date'], + latestauthor=r[-1]['from'], + latestsubject=r[-1]['subj'], + latestmsgid=r[-1]['msgid'], + ) + m.save() + m.patches.add(patch) + m.save() + parse_and_add_attachments(r, m) + PatchHistory(patch=patch, by=user, what='Attached mail thread %s' % r[0]['msgid']).save() patch.update_lastmail() patch.set_modified() |