mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-02-04 08:13:38 +00:00
some pylint related adjustments
This commit is contained in:
parent
375b591d7e
commit
8e15511b44
@ -146,23 +146,23 @@ def configure(request):
|
||||
@login_required
|
||||
def statuspage(request):
|
||||
"""Serve the status page """
|
||||
check_NAT = actions.run('dynamicDNS', ['get-nat'])
|
||||
check_nat = actions.run('dynamicDNS', ['get-nat'])
|
||||
last_update = actions.run('dynamicDNS', ['get-last-success'])
|
||||
|
||||
no_NAT = check_NAT.strip() == 'no'
|
||||
NAT_unchecked = check_NAT.strip() == 'unknown'
|
||||
no_nat = check_nat.strip() == 'no'
|
||||
nat_unchecked = check_nat.strip() == 'unknown'
|
||||
timer = actions.run('dynamicDNS', ['get-timer'])
|
||||
|
||||
if no_NAT:
|
||||
if no_nat:
|
||||
LOGGER.info('we are not behind a NAT')
|
||||
|
||||
if NAT_unchecked:
|
||||
if nat_unchecked:
|
||||
LOGGER.info('we did not checked if we are behind a NAT')
|
||||
|
||||
return TemplateResponse(request, 'dynamicDNS_status.html',
|
||||
{'title': _('Status of dynamicDNS Client'),
|
||||
'no_NAT': no_NAT,
|
||||
'NAT_unchecked': NAT_unchecked,
|
||||
'no_nat': no_nat,
|
||||
'nat_unchecked': nat_unchecked,
|
||||
'timer': timer,
|
||||
'last_update': last_update,
|
||||
'subsubmenu': subsubmenu})
|
||||
@ -207,20 +207,20 @@ def _apply_changes(request, old_status, new_status):
|
||||
"""Apply the changes to Dynamic DNS client"""
|
||||
LOGGER.info('New status is - %s', new_status)
|
||||
LOGGER.info('Old status was - %s', old_status)
|
||||
FAIL = False
|
||||
fail = False
|
||||
|
||||
if new_status['dynamicDNS_Secret_repeat'] != \
|
||||
new_status['dynamicDNS_Secret']:
|
||||
|
||||
messages.error(request, _('passwords does not match'))
|
||||
FAIL = True
|
||||
fail = True
|
||||
|
||||
if old_status['dynamicDNS_Secret'] == '' and \
|
||||
new_status['dynamicDNS_Secret'] == '':
|
||||
messages.error(request, _('please give a password'))
|
||||
FAIL = True
|
||||
fail = True
|
||||
|
||||
if False == FAIL:
|
||||
if False == fail:
|
||||
if new_status['dynamicDNS_Secret'] == '':
|
||||
new_status['dynamicDNS_Secret'] = old_status['dynamicDNS_Secret']
|
||||
|
||||
|
||||
@ -23,11 +23,11 @@
|
||||
{% block content %}
|
||||
<p>
|
||||
<h3>NAT type</h3>
|
||||
{% if NAT_unchecked %}
|
||||
{% if nat_unchecked %}
|
||||
NAT type not detected yet, if you do not provide a "IP check URL" we will
|
||||
not detect a NAT type.
|
||||
{% else %}
|
||||
{% if no_NAT %}
|
||||
{% if no_nat %}
|
||||
Direct connection to the internet.
|
||||
{% else %}
|
||||
Behind NAT, this means that dynamic DNS service will poll the
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user