diff --git a/deluge/core/core.py b/deluge/core/core.py index 6586fff05..e04fe25e5 100644 --- a/deluge/core/core.py +++ b/deluge/core/core.py @@ -603,7 +603,7 @@ class Core(component.Component): :raises DelugeError: if the username is not known """ - if username not in self.authmanager.get_known_accounts(): + if not self.authmanager.has_account(username): raise DelugeError("Username \"%s\" is not known." % username) if isinstance(torrent_ids, basestring): torrent_ids = [torrent_ids] diff --git a/deluge/ui/gtkui/menubar.py b/deluge/ui/gtkui/menubar.py index 6026f1387..f73f9cc02 100644 --- a/deluge/ui/gtkui/menubar.py +++ b/deluge/ui/gtkui/menubar.py @@ -47,6 +47,7 @@ import deluge.component as component from deluge.ui.client import client import deluge.common import common +import dialogs from deluge.configmanager import ConfigManager log = logging.getLogger(__name__) @@ -554,7 +555,16 @@ class MenuBar(component.Component): torrent_status = component.get("TorrentView").get_torrent_status(torrent_id) if torrent_status["owner"] != username: update_torrents.append(torrent_id) + if update_torrents: log.debug("Setting torrent owner \"%s\" on %s", username, update_torrents) - client.core.set_torrents_owner(update_torrents, username) + + def failed_change_owner(failure): + dialogs.ErrorDialog( + _("Ownership Change Error"), + _("There was an error while trying changing ownership."), + self.window.window, details=failure.value.logable() + ).run() + client.core.set_torrents_owner( + update_torrents, username).addErrback(failed_change_owner)