From caed5acceab381df08a8470b7cdc7ca8c4051764 Mon Sep 17 00:00:00 2001 From: Damien Churchill Date: Fri, 29 Jan 2010 15:35:51 +0000 Subject: [PATCH] use get_host() in connect() --- deluge/ui/web/json_api.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/deluge/ui/web/json_api.py b/deluge/ui/web/json_api.py index 8dc34763a..4b445f8ba 100644 --- a/deluge/ui/web/json_api.py +++ b/deluge/ui/web/json_api.py @@ -419,9 +419,8 @@ class WebApi(JSONComponent): d = Deferred() def on_connected(methods): d.callback(methods) - for host in self.host_list["hosts"]: - if host_id != host[0]: - continue + host = self.get_host(host_id) + if host: self._json.connect(*host[1:]).addCallback(on_connected) return d