]> git.ipfire.org Git - pbs.git/commitdiff
mirrors: Fix check
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 23 Jan 2025 20:34:54 +0000 (20:34 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 23 Jan 2025 20:34:54 +0000 (20:34 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/web/mirrors.py

index 4b15c300f457b537ecfdfc9b312baac29381f5cc..0888aae47d50dd15cea30fec55d60501c73a4e1a 100644 (file)
@@ -21,7 +21,7 @@ class ShowHandler(base.BaseHandler):
 class CheckHandler(base.BaseHandler):
        @base.authenticated
        async def post(self, hostname):
-               mirror = self.backend.mirrors.get_by_hostname(hostname)
+               mirror = await self.backend.mirrors.get_by_hostname(hostname)
                if not mirror:
                        raise tornado.web.HTTPError(404, "Could not find mirror %s" % hostname)
 
@@ -30,11 +30,11 @@ class CheckHandler(base.BaseHandler):
                        raise tornado.web.HTTPError(403, "%s has no permission for %s" \
                                % (self.current_user, mirror))
 
-               # check() creates its own transaction
+               # Run the check
                await mirror.check(force=True)
 
                # Redirect back to the mirror
-               self.redirect("/mirrors/%s" % mirror.hostname)
+               await self.redirect("/mirrors/%s" % mirror.hostname)
 
 
 class CreateHandler(base.BaseHandler):