mirror of
https://git.deluge-torrent.org/deluge
synced 2025-04-21 03:54:50 +00:00
webui:minor config fixes
This commit is contained in:
parent
24b7cff766
commit
8fb22554f2
3 changed files with 9 additions and 6 deletions
|
@ -44,9 +44,9 @@ config_page = component.get("ConfigPageManager")
|
|||
class NetworkPorts(config_forms.CfgForm ):
|
||||
title = _("Ports")
|
||||
info = _("Restart daemon after changing these values.")
|
||||
_port_from = forms.IntegerField(_("From"))
|
||||
_port_to = forms.IntegerField(_("To"))
|
||||
random_port = forms.CheckBox(_("Random"))
|
||||
_port_from = forms.IntegerField(label= _("From"),min_value = 0, max_value=65535)
|
||||
_port_to = forms.IntegerField(label = _("To"),min_value = 0, max_value=65535)
|
||||
random_port = forms.CheckBox(label = _("Random"))
|
||||
|
||||
def initial_data(self):
|
||||
data = config_forms.CfgForm.initial_data(self)
|
||||
|
@ -61,7 +61,7 @@ class NetworkPorts(config_forms.CfgForm ):
|
|||
|
||||
def validate(self, data):
|
||||
if (data['_port_to'] < data['_port_from']):
|
||||
raise ValidationError('"Port from" must be greater than "Port to"')
|
||||
raise forms.ValidationError('"Port from" must be greater than "Port to"')
|
||||
|
||||
config_page.register('network','ports', NetworkPorts)
|
||||
|
||||
|
|
|
@ -199,7 +199,11 @@ class DelugeInt(newforms.IntegerField):
|
|||
|
||||
class DelugeFloat(DelugeInt):
|
||||
def clean(self, value):
|
||||
return int(DelugeInt.clean(self, value))
|
||||
try:
|
||||
value = int(float(value)) #float->int
|
||||
except:
|
||||
pass
|
||||
return float(DelugeInt.clean(self, value))
|
||||
|
||||
#/fields
|
||||
|
||||
|
|
|
@ -260,5 +260,4 @@ ul.errorlist > li {
|
|||
display:inline;
|
||||
padding:0px;
|
||||
margin:0px;
|
||||
|
||||
}
|
Loading…
Add table
Reference in a new issue