def vacation_mode():
if is_local_request(flask.request):
json = flask.request.get_json()
enabled = json.get('enabled', False)
env.set_vacation_mode(enabled)
return "Vacation mode is now %r" % enabled
else:
logger.info('Vacation Mode accessed by remote address %s', flask.request.environ['REMOTE_ADDR'])
flask.abort(404)
评论列表
文章目录