Add auto-ptr setting injection

This commit is contained in:
SIPOS, Peter 2016-11-21 13:42:00 +01:00
parent 85eaa8dd69
commit 2d61c56e7b

View File

@ -58,6 +58,11 @@ def inject_default_domain_table_size_setting():
default_domain_table_size_setting = Setting.query.filter(Setting.name == 'default_domain_table_size').first() default_domain_table_size_setting = Setting.query.filter(Setting.name == 'default_domain_table_size').first()
return dict(default_domain_table_size_setting=default_domain_table_size_setting.value) return dict(default_domain_table_size_setting=default_domain_table_size_setting.value)
@app.context_processor
def inject_auto_ptr_setting():
auto_ptr_setting = Setting.query.filter(Setting.name == 'auto_ptr').first()
return dict(auto_ptr_setting=strtobool(auto_ptr_setting.value))
# START USER AUTHENTICATION HANDLER # START USER AUTHENTICATION HANDLER
@app.before_request @app.before_request
def before_request(): def before_request():