fix: default values of config options SignupKioskMode and BarcodeWebsocketAcl did not work
This commit is contained in:
parent
d163cfda05
commit
2fdc73c35b
2 changed files with 4 additions and 2 deletions
|
@ -70,7 +70,8 @@ def signup():
|
||||||
elif request.method != 'GET':
|
elif request.method != 'GET':
|
||||||
abort(405, 'Method not allowed')
|
abort(405, 'Method not allowed')
|
||||||
|
|
||||||
acl = netaddr.IPSet([addr.strip() for addr in config.get('SignupKioskMode', '').split(',')])
|
acl_addrs = [s.strip() for s in config.get('SignupKioskMode', '').split(',') if s.strip()]
|
||||||
|
acl = netaddr.IPSet(acl_addrs)
|
||||||
if request.remote_addr in acl:
|
if request.remote_addr in acl:
|
||||||
return template.render('signup_kiosk.html',
|
return template.render('signup_kiosk.html',
|
||||||
signup=(config.get('SignupEnabled', '0') == '1'),
|
signup=(config.get('SignupEnabled', '0') == '1'),
|
||||||
|
|
|
@ -29,7 +29,8 @@ def render(name: str, **kwargs):
|
||||||
global __jinja_env
|
global __jinja_env
|
||||||
config = get_app_config()
|
config = get_app_config()
|
||||||
template: jinja2.Template = __jinja_env.get_template(name)
|
template: jinja2.Template = __jinja_env.get_template(name)
|
||||||
wsacl = netaddr.IPSet([addr.strip() for addr in config.get('BarcodeWebsocketAcl', '').split(',')])
|
wsacl_addrs = [s.strip() for s in config.get('BarcodeWebsocketAcl', '').split(',') if s.strip()]
|
||||||
|
wsacl = netaddr.IPSet(wsacl_addrs)
|
||||||
if config.get('BarcodeWebsocketUrl', '') and hasattr(request, 'remote_addr') and request.remote_addr in wsacl:
|
if config.get('BarcodeWebsocketUrl', '') and hasattr(request, 'remote_addr') and request.remote_addr in wsacl:
|
||||||
bcwebsocket = config.get('BarcodeWebsocketUrl')
|
bcwebsocket = config.get('BarcodeWebsocketUrl')
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue