2020-08-19 17:21:19 +00:00
|
|
|
import logging
|
|
|
|
|
|
|
|
from app.classes.web.base_handler import BaseHandler
|
|
|
|
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
|
|
|
|
|
|
|
|
class DefaultHandler(BaseHandler):
|
|
|
|
|
2020-08-19 17:54:10 +00:00
|
|
|
# Override prepare() instead of get() to cover all possible HTTP methods.
|
2020-08-23 22:43:28 +00:00
|
|
|
def prepare(self, page=None):
|
|
|
|
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(
|
|
|
|
"/public/login",
|
2021-04-03 18:18:43 +00:00
|
|
|
#translate=self.translator.translate,
|
2021-03-26 13:57:50 +00:00
|
|
|
)
|
2020-08-19 17:21:19 +00:00
|
|
|
|