crafty-4/app/classes/web/default_handler.py
2023-02-16 23:29:06 +00:00

21 lines
572 B
Python

import logging
from app.classes.web.base_handler import BaseHandler
logger = logging.getLogger(__name__)
class DefaultHandler(BaseHandler):
# Override prepare() instead of get() to cover all possible HTTP methods.
def prepare(self, page=None): # pylint: disable=arguments-differ
if page is not None:
self.set_status(404)
self.render(
"public/404.html",
translate=self.translator.translate,
)
else:
self.redirect(
"/panel/dashboard",
)