forked from s3lph/matemat
fix: non-http templates
This commit is contained in:
parent
418d7ffea9
commit
e23ba65c71
1 changed files with 1 additions and 1 deletions
|
@ -30,7 +30,7 @@ def render(name: str, **kwargs):
|
|||
config = get_app_config()
|
||||
template: jinja2.Template = __jinja_env.get_template(name)
|
||||
wsacl = netaddr.IPSet([addr.strip() for addr in config.get('BarcodeWebsocketAcl', '').split(',')])
|
||||
if config.get('BarcodeWebsocketUrl', '') 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')
|
||||
else:
|
||||
bcwebsocket = None
|
||||
|
|
Loading…
Reference in a new issue