forked from s3lph/matemat
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':
|
||||
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:
|
||||
return template.render('signup_kiosk.html',
|
||||
signup=(config.get('SignupEnabled', '0') == '1'),
|
||||
|
|
|
@ -29,7 +29,8 @@ def render(name: str, **kwargs):
|
|||
global __jinja_env
|
||||
config = get_app_config()
|
||||
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:
|
||||
bcwebsocket = config.get('BarcodeWebsocketUrl')
|
||||
else:
|
||||
|
|
Loading…
Reference in a new issue