From 63a7df1099f789ece4d97f5d5cc22d513edde675 Mon Sep 17 00:00:00 2001 From: Martin Zimmermann Date: Thu, 21 Nov 2013 10:17:29 +0100 Subject: [PATCH 1/2] translate deletion and activation links --- isso/ext/notifications.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/isso/ext/notifications.py b/isso/ext/notifications.py index 78e366a..98f8436 100644 --- a/isso/ext/notifications.py +++ b/isso/ext/notifications.py @@ -96,10 +96,10 @@ class SMTP(object): key = self.isso.sign(comment["id"]) rv.write("---\n") - rv.write("Kommentar löschen: %s\n" % (uri + "/delete/" + key)) + rv.write("Delete comment: %s\n" % (uri + "/delete/" + key)) if comment["mode"] == 2: - rv.write("Kommentar freischalten: %s\n" % (uri + "/activate/" + key)) + rv.write("Activate comment: %s\n" % (uri + "/activate/" + key)) rv.seek(0) return rv.read() From 5449b0cea4953ad7f4693a2248f76c4f4c0cc17a Mon Sep 17 00:00:00 2001 From: Martin Zimmermann Date: Thu, 21 Nov 2013 10:17:42 +0100 Subject: [PATCH 2/2] add route for comment activation --- isso/views/comments.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/isso/views/comments.py b/isso/views/comments.py index aa3ecb1..0fe1a0a 100644 --- a/isso/views/comments.py +++ b/isso/views/comments.py @@ -47,6 +47,7 @@ class API(object): ('edit', ('PUT', '/id/')), ('delete', ('DELETE', '/id/')), ('delete', ('GET', '/id//delete/')), + ('activate',('GET', '/id//activate/')), ('like', ('POST', '/id//like')), ('dislike', ('POST', '/id//dislike')), ('checkip', ('GET', '/check-ip')) @@ -253,7 +254,7 @@ class API(object): resp.headers.add("X-Set-Cookie", cookie("isso-%i" % id)) return resp - def activate(self, environ, request, _, key): + def activate(self, environ, request, id, key): try: id = self.isso.unsign(key, max_age=2**32)