mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
fix formatting issues
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
1 parent
fa74a26042
commit
eb83e00011
134 files changed
+598
-720
No files matched your search
@@ -86,9 +86,10 @@ def init():
|
||||
app = DynamicDNSApp()
|
||||
current_status = get_status()
|
||||
if current_status['enabled']:
|
||||
domain_added.send_robust(
|
||||
sender='dynamicdns', domain_type='domain-type-dynamic',
|
||||
name=current_status['dynamicdns_domain'], services='__all__')
|
||||
domain_added.send_robust(sender='dynamicdns',
|
||||
domain_type='domain-type-dynamic',
|
||||
name=current_status['dynamicdns_domain'],
|
||||
services='__all__')
|
||||
app.set_enabled(True)
|
||||
|
||||
|
||||
|
||||
@@ -28,7 +28,6 @@ from plinth.utils import format_lazy
|
||||
|
||||
class TrimmedCharField(forms.CharField):
|
||||
"""Trim the contents of a CharField."""
|
||||
|
||||
def clean(self, value):
|
||||
"""Clean and validate the field value"""
|
||||
if value:
|
||||
@@ -81,12 +80,12 @@ class ConfigureForm(forms.Form):
|
||||
'freedns.afraid.org'),
|
||||
('other', 'other update URL'))
|
||||
|
||||
enabled = forms.BooleanField(
|
||||
label=ugettext_lazy('Enable Dynamic DNS'), required=False)
|
||||
enabled = forms.BooleanField(label=ugettext_lazy('Enable Dynamic DNS'),
|
||||
required=False)
|
||||
|
||||
service_type = forms.ChoiceField(
|
||||
label=ugettext_lazy('Service Type'), help_text=help_services,
|
||||
choices=provider_choices)
|
||||
service_type = forms.ChoiceField(label=ugettext_lazy('Service Type'),
|
||||
help_text=help_services,
|
||||
choices=provider_choices)
|
||||
|
||||
dynamicdns_server = TrimmedCharField(
|
||||
label=ugettext_lazy('GnuDIP Server Address'), required=False,
|
||||
@@ -95,9 +94,9 @@ class ConfigureForm(forms.Form):
|
||||
ugettext_lazy('Invalid server name'))
|
||||
])
|
||||
|
||||
dynamicdns_update_url = TrimmedCharField(
|
||||
label=ugettext_lazy('Update URL'), required=False,
|
||||
help_text=help_update_url)
|
||||
dynamicdns_update_url = TrimmedCharField(label=ugettext_lazy('Update URL'),
|
||||
required=False,
|
||||
help_text=help_update_url)
|
||||
|
||||
disable_SSL_cert_check = forms.BooleanField(
|
||||
label=ugettext_lazy('Accept all SSL certificates'),
|
||||
@@ -114,15 +113,15 @@ class ConfigureForm(forms.Form):
|
||||
ugettext_lazy('Invalid domain name'))
|
||||
])
|
||||
|
||||
dynamicdns_user = TrimmedCharField(
|
||||
label=ugettext_lazy('Username'), required=False, help_text=help_user)
|
||||
dynamicdns_user = TrimmedCharField(label=ugettext_lazy('Username'),
|
||||
required=False, help_text=help_user)
|
||||
|
||||
dynamicdns_secret = TrimmedCharField(
|
||||
label=ugettext_lazy('Password'), widget=forms.PasswordInput(),
|
||||
required=False, help_text=help_secret)
|
||||
dynamicdns_secret = TrimmedCharField(label=ugettext_lazy('Password'),
|
||||
widget=forms.PasswordInput(),
|
||||
required=False, help_text=help_secret)
|
||||
|
||||
showpw = forms.BooleanField(
|
||||
label=ugettext_lazy('Show password'), required=False)
|
||||
showpw = forms.BooleanField(label=ugettext_lazy('Show password'),
|
||||
required=False)
|
||||
|
||||
dynamicdns_ipurl = TrimmedCharField(
|
||||
label=ugettext_lazy('URL to look up public IP'), required=False,
|
||||
|
||||
@@ -39,15 +39,13 @@ EMPTYSTRING = 'none'
|
||||
subsubmenu = [{
|
||||
'url': reverse_lazy('dynamicdns:index'),
|
||||
'text': ugettext_lazy('About')
|
||||
},
|
||||
{
|
||||
'url': reverse_lazy('dynamicdns:configure'),
|
||||
'text': ugettext_lazy('Configure')
|
||||
},
|
||||
{
|
||||
'url': reverse_lazy('dynamicdns:statuspage'),
|
||||
'text': ugettext_lazy('Status')
|
||||
}]
|
||||
}, {
|
||||
'url': reverse_lazy('dynamicdns:configure'),
|
||||
'text': ugettext_lazy('Configure')
|
||||
}, {
|
||||
'url': reverse_lazy('dynamicdns:statuspage'),
|
||||
'text': ugettext_lazy('Status')
|
||||
}]
|
||||
|
||||
|
||||
def index(request):
|
||||
@@ -164,9 +162,10 @@ def _apply_changes(request, old_status, new_status):
|
||||
_run(['stop'])
|
||||
|
||||
if new_status['enabled']:
|
||||
domain_added.send_robust(
|
||||
sender='dynamicdns', domain_type='domain-type-dynamic',
|
||||
name=new_status['dynamicdns_domain'], services='__all__')
|
||||
domain_added.send_robust(sender='dynamicdns',
|
||||
domain_type='domain-type-dynamic',
|
||||
name=new_status['dynamicdns_domain'],
|
||||
services='__all__')
|
||||
_run(['start'])
|
||||
|
||||
messages.success(request, _('Configuration updated'))
|
||||
|
||||
Reference in new issue
Block a user