def _protect_before_contest_hook():
"""Before-request hook to protect the whole website before the contest."""
if bottle.request.path.startswith(('/health', '/ping', '/api/', '/admin/')):
return
if not is_admin() and not settings.has_contest_started():
bottle.abort(403, 'The contest has not started yet.')
评论列表
文章目录