Final fix!

This commit is contained in:
Antoine Nguyen
2014-11-05 14:21:23 +01:00
parent d139931016
commit d2c6bcd2b4
+2 -2
View File
@@ -141,9 +141,9 @@ def viewheaders(request, mail_id):
msg = email.message_from_string(content)
headers = []
for name, value in msg.items():
if value and type(value) is unicode:
if value:
result = chardet.detect(value)
if chardet["encoding"] is not None:
if result["encoding"] is not None:
value = value.decode(result["encoding"])
headers += [(name, value)]
return render(request, 'amavis/viewheader.html', {