-def blacklisted(method):
- @functools.wraps(method)
- async def wrapper(self, *args, **kwargs):
- # Check if remote is blacklisted
- is_blacklisted = await self.remote.is_blacklisted()
-
- # If so, redirect to the blocked page
- if is_blacklisted:
- logging.warning("%s is blacklisted" % self.remote)
-
- return self.redirect("https://www.ipfire.org/blocked")
-
- return method(self, *args, **kwargs)
-
- return wrapper
-