diff options
author | Magnus Hagander | 2013-08-18 15:54:29 +0000 |
---|---|---|
committer | Magnus Hagander | 2013-08-18 15:54:29 +0000 |
commit | 9e842b511ceff45b0e86f2116425faa78fcb0f72 (patch) | |
tree | c537d7a7b8dd182e2e084d76702a81ab4d53c03e /pgcommitfest/commitfest/ajax.py | |
parent | 66ca5a125b0ad16d867ce65d3621156765f7b43e (diff) |
Track which attachments are actually patches
This weill eventually get exposed as some sort of API for a buildbot,
but we might as well track it and show it on the website already now.
Diffstat (limited to 'pgcommitfest/commitfest/ajax.py')
-rw-r--r-- | pgcommitfest/commitfest/ajax.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/pgcommitfest/commitfest/ajax.py b/pgcommitfest/commitfest/ajax.py index 7c73771..469d630 100644 --- a/pgcommitfest/commitfest/ajax.py +++ b/pgcommitfest/commitfest/ajax.py @@ -58,12 +58,16 @@ def getThreads(request): def parse_and_add_attachments(threadinfo, mailthread): for t in threadinfo: - if t['att']: + if len(t['atts']): + # One or more attachments. For now, we're only actually going + # to store and process the first one, even though the API gets + # us all of them. MailThreadAttachment.objects.get_or_create(mailthread=mailthread, messageid=t['msgid'], defaults={ 'date': t['date'], - 'author': t['from'] + 'author': t['from'], + 'attachmentid': t['atts'][0], }) # In theory we should remove objects if they don't have an # attachment, but how could that ever happen? Ignore for now. |