From 73c7933548fa9ea4d64a6a159d39af001cfdde2d Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Mon, 2 Apr 2018 23:02:45 +0200 Subject: [PATCH] A quick dirty fix of #401 (#406) Fix URL in moderation mails if isso runs in a sub-URL (closes #401 ) --- isso/ext/notifications.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/isso/ext/notifications.py b/isso/ext/notifications.py index 80e1504..2b4a81c 100644 --- a/isso/ext/notifications.py +++ b/isso/ext/notifications.py @@ -37,6 +37,12 @@ class SMTP(object): self.isso = isso self.conf = isso.conf.section("smtp") + gh = isso.conf.get("general", "host") + if type(gh) == str: + self.general_host = gh + #if gh is not a string then gh is a list + else: + self.general_host = gh[0] # test SMTP connectivity try: @@ -109,7 +115,7 @@ class SMTP(object): (local("origin") + thread["uri"] + "#isso-%i" % comment["id"])) rv.write("\n") - uri = local("host") + "/id/%i" % comment["id"] + uri = self.general_host + "/id/%i" % comment["id"] key = self.isso.sign(comment["id"]) rv.write("---\n")