summaryrefslogtreecommitdiff
path: root/pgcommitfest/commitfest
diff options
context:
space:
mode:
Diffstat (limited to 'pgcommitfest/commitfest')
-rw-r--r--pgcommitfest/commitfest/ajax.py8
-rw-r--r--pgcommitfest/commitfest/models.py2
-rw-r--r--pgcommitfest/commitfest/templates/patch.html3
3 files changed, 9 insertions, 4 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.
diff --git a/pgcommitfest/commitfest/models.py b/pgcommitfest/commitfest/models.py
index e4326db..e7ac9c7 100644
--- a/pgcommitfest/commitfest/models.py
+++ b/pgcommitfest/commitfest/models.py
@@ -184,8 +184,10 @@ class MailThread(models.Model):
class MailThreadAttachment(models.Model):
mailthread = models.ForeignKey(MailThread, null=False, blank=False)
messageid = models.CharField(max_length=1000, null=False, blank=False)
+ attachmentid = models.IntegerField(null=False, blank=False)
date = models.DateTimeField(null=False, blank=False)
author = models.CharField(max_length=500, null=False, blank=False)
+ ispatch = models.NullBooleanField()
class Meta:
ordering = ('-date',)
diff --git a/pgcommitfest/commitfest/templates/patch.html b/pgcommitfest/commitfest/templates/patch.html
index e69dcf4..09fe9a9 100644
--- a/pgcommitfest/commitfest/templates/patch.html
+++ b/pgcommitfest/commitfest/templates/patch.html
@@ -70,9 +70,8 @@
{%if forloop.first%}
Latest attachment at <a href="http://www.postgrsql.org/message-id/{{ta.messageid}}/">{{ta.date}}</a> from {{ta.author|hidemail}} <button type="button" class="btn btn-mini" data-toggle="collapse" data-target="#att{{t.pk}}"><i class="icon-plus"></i></button>
<div id="att{{t.pk}}" class="collapse">
- {%else%}
- &nbsp;&nbsp;&nbsp;&nbsp;Attachment at <a href="http://www.postgresql.org/message-id/{{ta.messageid}}/">{{ta.date}}</a> from {{ta.author|hidemail}}<br/>
{%endif%}
+ &nbsp;&nbsp;&nbsp;&nbsp;Attachment at <a href="http://www.postgresql.org/message-id/{{ta.messageid}}/">{{ta.date}}</a> from {{ta.author|hidemail}} (Patch: {{ta.ispatch|yesno:"Yes,No,Pending check"}})<br/>
{%if forloop.last%}</div>{%endif%}
{%endfor%}
</dd>