Fix email preview for TXT templates on python3

This commit is contained in:
Lance Edgar 2020-02-09 15:32:22 -06:00
parent 6925c460c5
commit 76839c48cf

View file

@ -2,7 +2,7 @@
################################################################################ ################################################################################
# #
# Rattail -- Retail Software Framework # Rattail -- Retail Software Framework
# Copyright © 2010-2019 Lance Edgar # Copyright © 2010-2020 Lance Edgar
# #
# This file is part of Rattail. # This file is part of Rattail.
# #
@ -323,7 +323,7 @@ class EmailPreview(View):
data = email.obtain_sample_data(self.request) data = email.obtain_sample_data(self.request)
self.request.response.text = template.render(**data) self.request.response.text = template.render(**data)
if type_ == 'txt': if type_ == 'txt':
self.request.response.content_type = b'text/plain' self.request.response.content_type = str('text/plain')
return self.request.response return self.request.response
@classmethod @classmethod