You're mixing strings and unicodes. Given the error message I guess that this is what happens:
>>> message = u''
>>> message += '%s</div>' % ('<div> • <b>PASPĮ</b>:')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc4 in position 34: ordinal not in range(128)
You can deal with it by making sure that in the change.get('new_value')
call a unicode string is returned. You can do either this (notice the u
sign before the string in parentheses):
message += '%s</div>' % (u'<div> • <b>PASPĮ</b>:')
or this (notice the .decode('utf-8')
:
message += '%s</div>' % ('<div> • <b>PASPĮ</b>:'.decode('utf-8'))