summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDjLegolas <djlegolas@protonmail.com>2022-08-01 20:08:45 +0300
committerCalum Lind <calumlind+deluge@gmail.com>2023-02-27 17:39:00 +0000
commit543fce4f296d65526c746e2bf8ba7a89c906ff87 (patch)
treec7f0fee2bb904cc393ad83d6022ad51c0ef078e3
parent38feea0fa46913de8a070a6c19669d07df596571 (diff)
downloaddeluge-543fce4f296d65526c746e2bf8ba7a89c906ff87.tar.gz
deluge-543fce4f296d65526c746e2bf8ba7a89c906ff87.tar.bz2
deluge-543fce4f296d65526c746e2bf8ba7a89c906ff87.zip
[console] Fix add host in connection manager
The input is being passed as `str` instead of `int`, so added a conversion only if the string is indeed a decimal number. In addition, closing the add host popup after adding it. Closes: https://dev.deluge-torrent.org/ticket/3538
-rw-r--r--deluge/ui/console/modes/connectionmanager.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/deluge/ui/console/modes/connectionmanager.py b/deluge/ui/console/modes/connectionmanager.py
index 0ccdd93db..6cf5e79b5 100644
--- a/deluge/ui/console/modes/connectionmanager.py
+++ b/deluge/ui/console/modes/connectionmanager.py
@@ -127,12 +127,14 @@ class ConnectionManager(BaseMode, PopupsHandler):
def add_host(self, hostname, port, username, password):
log.info('Adding host: %s', hostname)
+ if port.isdecimal():
+ port = int(port)
try:
self.hostlist.add_host(hostname, port, username, password)
except ValueError as ex:
self.report_message(_('Error adding host'), f'{hostname}: {ex}')
else:
- self.update_select_host_popup()
+ self.pop_popup()
def delete_host(self, host_id):
log.info('Deleting host: %s', host_id)