summaryrefslogtreecommitdiff
path: root/pgweb/mailqueue/admin.py
diff options
context:
space:
mode:
authorMagnus Hagander2020-07-03 15:51:01 +0000
committerMagnus Hagander2020-07-03 16:05:47 +0000
commit59793b0ca7fd42e5317a5adb33faf1fd550a3714 (patch)
tree146a827256c8e5dc1ee49c1834c5d4c4aee34751 /pgweb/mailqueue/admin.py
parentc1a5cf4c27ed2aae0c6a8525295956776ff08410 (diff)
Fix message preview in mailqueue model
UTF8 encoding issues since the python3 migration...
Diffstat (limited to 'pgweb/mailqueue/admin.py')
-rw-r--r--pgweb/mailqueue/admin.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/pgweb/mailqueue/admin.py b/pgweb/mailqueue/admin.py
index 6b89205c..468283b6 100644
--- a/pgweb/mailqueue/admin.py
+++ b/pgweb/mailqueue/admin.py
@@ -17,13 +17,13 @@ class QueuedMailAdmin(admin.ModelAdmin):
msg = parser.parsestr(obj.fullmsg)
b = msg.get_payload(decode=True)
if b:
- return b
+ return b.decode('utf8')
pl = msg.get_payload()
for p in pl:
b = p.get_payload(decode=True)
if b:
- return b
+ return b.decode('utf8')
return "Could not find body"
except Exception as e:
return "Failed to get body: %s" % e