]> git.ipfire.org Git - ipfire.org.git/commitdiff
Fix submitting newsletter form
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 6 Nov 2018 11:01:12 +0000 (11:01 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 6 Nov 2018 11:01:12 +0000 (11:01 +0000)
The blacklist check does not work with functions that
are decorated by the @tornado.gen.coroutine decorator

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/web/newsletter.py

index 12909ade6a669e023442b03e42737bfb6910d3d9..05f92d7324c868eee08780070b9dad8153f13cab 100644 (file)
@@ -8,8 +8,12 @@ import tornado.process
 from . import base
 
 class SubscribeHandler(base.BaseHandler):
-       @tornado.gen.coroutine
        @base.blacklisted
+       def prepare(self):
+               # Makes sure that we call blacklist for everything
+               pass
+
+       @tornado.gen.coroutine
        def post(self):
                address = self.get_argument("email")