2020-08-19 17:21:19 +00:00
|
|
|
import logging
|
|
|
|
|
|
|
|
from app.classes.web.base_handler import BaseHandler
|
|
|
|
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
|
2022-03-23 02:50:12 +00:00
|
|
|
|
2020-08-19 17:21:19 +00:00
|
|
|
class DefaultHandler(BaseHandler):
|
2020-08-19 17:54:10 +00:00
|
|
|
# Override prepare() instead of get() to cover all possible HTTP methods.
|
2022-04-14 02:10:25 +00:00
|
|
|
def prepare(self, page=None): # pylint: disable=arguments-differ
|
2020-08-23 22:43:28 +00:00
|
|
|
if page is not None:
|
|
|
|
self.set_status(404)
|
2021-03-26 13:57:50 +00:00
|
|
|
self.render(
|
|
|
|
"public/404.html",
|
|
|
|
translate=self.translator.translate,
|
|
|
|
)
|
2020-08-23 22:43:28 +00:00
|
|
|
else:
|
2021-03-26 13:57:50 +00:00
|
|
|
self.redirect(
|
2023-01-28 15:43:27 +00:00
|
|
|
"/panel/dashboard",
|
2021-03-26 13:57:50 +00:00
|
|
|
)
|