mirror of
https://github.com/minetest/contentdb.git
synced 2024-11-10 01:23:48 +01:00
Fix crash when sending emails
This commit is contained in:
parent
610ed8fca5
commit
5a4238dabc
@ -17,7 +17,7 @@
|
||||
from datetime import datetime as dt
|
||||
from urllib.parse import urlparse
|
||||
|
||||
from flask import request
|
||||
from flask import request, has_request_context
|
||||
from flask_babel import format_timedelta, gettext
|
||||
from flask_login import current_user
|
||||
from markupsafe import Markup
|
||||
@ -31,7 +31,10 @@ from .utils.minetest_hypertext import normalize_whitespace as do_normalize_white
|
||||
|
||||
@app.context_processor
|
||||
def inject_misc():
|
||||
return dict(debug=app.debug, hide_nonfree=request.cookies.get("hide_nonfree") == "1")
|
||||
hide_nonfree = False
|
||||
if has_request_context():
|
||||
hide_nonfree = request.cookies.get("hide_nonfree") == "1"
|
||||
return dict(debug=app.debug, hide_nonfree=hide_nonfree)
|
||||
|
||||
|
||||
@app.context_processor
|
||||
|
Loading…
Reference in New Issue
Block a user