mirror of
https://github.com/janeczku/calibre-web
synced 2024-11-25 11:07:22 +00:00
Catch error with tornado on restart
This commit is contained in:
parent
2fbc3da451
commit
184ce23351
@ -102,10 +102,13 @@ def admin_required(f):
|
|||||||
|
|
||||||
@admi.before_app_request
|
@admi.before_app_request
|
||||||
def before_request():
|
def before_request():
|
||||||
|
try:
|
||||||
if not ub.check_user_session(current_user.id,
|
if not ub.check_user_session(current_user.id,
|
||||||
flask_session.get('_id')) and 'opds' not in request.path \
|
flask_session.get('_id')) and 'opds' not in request.path \
|
||||||
and config.config_session == 1:
|
and config.config_session == 1:
|
||||||
logout_user()
|
logout_user()
|
||||||
|
except AttributeError:
|
||||||
|
pass # ? fails on requesting /ajax/emailstat during restart ?
|
||||||
g.constants = constants
|
g.constants = constants
|
||||||
g.google_site_verification = os.getenv('GOOGLE_SITE_VERIFICATION', '')
|
g.google_site_verification = os.getenv('GOOGLE_SITE_VERIFICATION', '')
|
||||||
g.allow_registration = config.config_public_reg
|
g.allow_registration = config.config_public_reg
|
||||||
|
Loading…
Reference in New Issue
Block a user