Skip to content

Commit c14b972

Browse files
committed
another mailing test, thanks Hadi
1 parent 4c8ab44 commit c14b972

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

py4web/utils/auth.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -995,10 +995,10 @@ def send(self, name, user, **attrs):
995995
subject = message["subject"].format(**d)
996996
if isinstance(message["body"], (list, tuple)):
997997
# the body is (TEXT, HTML)
998-
body = [element.format(**d) for element in message["body"]]
998+
body = [str(element.format(**d)) for element in message["body"]]
999999
else:
10001000
# the body is TEXT
1001-
body = message["body"].format(**d)
1001+
body = str(message["body"].format(**d))
10021002
if not self.sender:
10031003
print('Mock send to %s subject "%s" body:\n%s\n' % (email, subject, body))
10041004
return True
@@ -1069,13 +1069,13 @@ def enable(self, route="auth", uses=(), env=None, spa=False, allow_api_routes=Tr
10691069
for group in self.param.messages.values():
10701070
for key, value in group.items():
10711071
if isinstance(value, str):
1072-
group[key] = str(T(value))
1072+
group[key] = T(value)
10731073
elif (
10741074
key == "body"
10751075
and isinstance(value, (list, tuple))
10761076
and len(value) == 2
10771077
):
1078-
group[key] = (str(T(value[0])), str(T(value[1])))
1078+
group[key] = (T(value[0]), T(value[1]))
10791079
else:
10801080
raise RuntimeError(f"Invalid message type {key}:{value}")
10811081

0 commit comments

Comments
 (0)