From 5bffa3757d5c16d2fb1db38d30343be2df4ba2f4 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Tue, 5 Jul 2011 15:29:51 +0100 Subject: [PATCH] Don't default to "localclient" as owner unconditionally. Only set "localclient" as a last resort, first try to find out who is logged in. --- deluge/core/torrentmanager.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/deluge/core/torrentmanager.py b/deluge/core/torrentmanager.py index fb21e8c45..3c289a676 100644 --- a/deluge/core/torrentmanager.py +++ b/deluge/core/torrentmanager.py @@ -345,9 +345,14 @@ class TorrentManager(component.Component): def add(self, torrent_info=None, state=None, options=None, save_state=True, filedump=None, filename=None, magnet=None, resume_data=None, - owner='localclient'): + owner=Ellipsis): """Add a torrent to the manager and returns it's torrent_id""" + if owner is Ellipsis: + owner = component.get("RPCServer").get_session_user() + if not owner: + owner = "localclient" + if torrent_info is None and state is None and filedump is None and magnet is None: log.debug("You must specify a valid torrent_info, torrent state or magnet.") return