summaryrefslogtreecommitdiff
path: root/pgcommitfest/commitfest/ajax.py
diff options
context:
space:
mode:
authorMagnus Hagander2014-07-15 10:38:26 +0000
committerMagnus Hagander2014-07-15 10:38:26 +0000
commit6b122c0a57cce9594953e94f9d49141ae1f87d09 (patch)
tree75a4432c8ab637a8a9e133d71c2047fbe87534cc /pgcommitfest/commitfest/ajax.py
parentef49d457cc79b41f92a3d66369256fbca9730536 (diff)
Properly update last email when attaching an existing thread
Diffstat (limited to 'pgcommitfest/commitfest/ajax.py')
-rw-r--r--pgcommitfest/commitfest/ajax.py34
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()