some pylint related adjustments

This commit is contained in:
Daniel Steglich 2015-01-04 14:07:55 +01:00
parent 375b591d7e
commit 8e15511b44
2 changed files with 13 additions and 13 deletions

View File

@ -146,23 +146,23 @@ def configure(request):
@login_required @login_required
def statuspage(request): def statuspage(request):
"""Serve the status page """ """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']) last_update = actions.run('dynamicDNS', ['get-last-success'])
no_NAT = check_NAT.strip() == 'no' no_nat = check_nat.strip() == 'no'
NAT_unchecked = check_NAT.strip() == 'unknown' nat_unchecked = check_nat.strip() == 'unknown'
timer = actions.run('dynamicDNS', ['get-timer']) timer = actions.run('dynamicDNS', ['get-timer'])
if no_NAT: if no_nat:
LOGGER.info('we are not behind a 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') LOGGER.info('we did not checked if we are behind a NAT')
return TemplateResponse(request, 'dynamicDNS_status.html', return TemplateResponse(request, 'dynamicDNS_status.html',
{'title': _('Status of dynamicDNS Client'), {'title': _('Status of dynamicDNS Client'),
'no_NAT': no_NAT, 'no_nat': no_nat,
'NAT_unchecked': NAT_unchecked, 'nat_unchecked': nat_unchecked,
'timer': timer, 'timer': timer,
'last_update': last_update, 'last_update': last_update,
'subsubmenu': subsubmenu}) 'subsubmenu': subsubmenu})
@ -207,20 +207,20 @@ def _apply_changes(request, old_status, new_status):
"""Apply the changes to Dynamic DNS client""" """Apply the changes to Dynamic DNS client"""
LOGGER.info('New status is - %s', new_status) LOGGER.info('New status is - %s', new_status)
LOGGER.info('Old status was - %s', old_status) LOGGER.info('Old status was - %s', old_status)
FAIL = False fail = False
if new_status['dynamicDNS_Secret_repeat'] != \ if new_status['dynamicDNS_Secret_repeat'] != \
new_status['dynamicDNS_Secret']: new_status['dynamicDNS_Secret']:
messages.error(request, _('passwords does not match')) messages.error(request, _('passwords does not match'))
FAIL = True fail = True
if old_status['dynamicDNS_Secret'] == '' and \ if old_status['dynamicDNS_Secret'] == '' and \
new_status['dynamicDNS_Secret'] == '': new_status['dynamicDNS_Secret'] == '':
messages.error(request, _('please give a password')) messages.error(request, _('please give a password'))
FAIL = True fail = True
if False == FAIL: if False == fail:
if new_status['dynamicDNS_Secret'] == '': if new_status['dynamicDNS_Secret'] == '':
new_status['dynamicDNS_Secret'] = old_status['dynamicDNS_Secret'] new_status['dynamicDNS_Secret'] = old_status['dynamicDNS_Secret']

View File

@ -23,11 +23,11 @@
{% block content %} {% block content %}
<p> <p>
<h3>NAT type</h3> <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 NAT type not detected yet, if you do not provide a "IP check URL" we will
not detect a NAT type. not detect a NAT type.
{% else %} {% else %}
{% if no_NAT %} {% if no_nat %}
Direct connection to the internet. Direct connection to the internet.
{% else %} {% else %}
Behind NAT, this means that dynamic DNS service will poll the Behind NAT, this means that dynamic DNS service will poll the