nat: rename bound variable

This commit is contained in:
Timotej Lazar 2023-12-04 09:47:50 +01:00
parent 32b182856d
commit 92e552eb76

View file

@ -13,13 +13,13 @@ def index():
return flask.Response('forbidden', status=403, mimetype='text/plain')
with db.locked():
nat = { office: "" for office in db.read('networks') }
nat = { network: "" for network in db.read('networks') }
nat |= db.read('nat')
if flask.request.method == 'POST':
form = flask.request.form
for office, address in form.items():
if office in nat:
nat[office] = address
for network, address in form.items():
if network in nat:
nat[network] = address
db.write('nat', nat)
system.run(system.save_config)
return flask.redirect(flask.url_for('nat.index'))