1
0
Fork 1
mirror of https://github.com/coddingtonbear/django-mailbox.git synced 2026-07-09 22:38:19 +02:00

Adding envelope headers to the Admin interface.

This commit is contained in:
Adam Coddington 2014-12-31 09:40:36 -06:00
parent 413c492db3
commit d276f7e9a9

View file

@ -64,6 +64,12 @@ class MessageAdmin(admin.ModelAdmin):
def subject(self, msg):
return convert_header_to_unicode(msg.subject)
def envelope_headers(self, msg):
email = msg.get_email_object()
return '\n'.join(
[('%s: %s' % (h, v)) for h, v in email.items()]
)
inlines = [
MessageAttachmentInline,
]
@ -89,6 +95,7 @@ class MessageAdmin(admin.ModelAdmin):
'in_reply_to',
)
readonly_fields = (
'envelope_headers',
'text',
'html',
)