diff options
author | DjLegolas <djlegolas@protonmail.com> | 2022-08-01 20:08:45 +0300 |
---|---|---|
committer | Calum Lind <calumlind+deluge@gmail.com> | 2023-02-27 17:39:00 +0000 |
commit | 543fce4f296d65526c746e2bf8ba7a89c906ff87 (patch) | |
tree | c7f0fee2bb904cc393ad83d6022ad51c0ef078e3 | |
parent | 38feea0fa46913de8a070a6c19669d07df596571 (diff) | |
download | deluge-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.py | 4 |
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) |