Fix email preview logic per python 3

can't use filter() anymore
This commit is contained in:
Lance Edgar 2018-06-28 12:25:44 -05:00
parent 6b01a7e888
commit b9d699df84

View file

@ -280,7 +280,8 @@ class EmailPreview(View):
def email_template(self):
recipient = self.request.POST.get('recipient')
if recipient:
keys = filter(lambda k: k.startswith('send_'), self.request.POST.keys())
keys = [key for key in self.request.POST.keys()
if key.startswith('send_')]
key = keys[0][5:] if keys else None
if key:
email = mail.get_email(self.rattail_config, key)