From 19b3399d0f4e9ea8c47afff0d0056d3582b5c468 Mon Sep 17 00:00:00 2001 From: Bernat Brunet Torruella Date: Sun, 25 May 2014 08:02:29 +0200 Subject: [PATCH] Fix bug whne try to open the client with an URL --- client-open_url.diff | 21 +++++++++++++++++++++ series | 1 + 2 files changed, 22 insertions(+) create mode 100644 client-open_url.diff diff --git a/client-open_url.diff b/client-open_url.diff new file mode 100644 index 0000000..c3a4e40 --- /dev/null +++ b/client-open_url.diff @@ -0,0 +1,21 @@ +diff -r 072562663a50 tryton/gui/main.py +--- ./tryton/tryton/gui/main.py Fri May 09 10:13:53 2014 +0200 ++++ ./tryton/tryton/gui/main.py Sat May 24 18:14:02 2014 +0200 +@@ -1420,10 +1420,12 @@ + if not urlp.scheme == 'tryton': + return + urlp = urlparse('http' + url[6:]) +- hostname, port = map(urllib.unquote, +- (urlp.netloc.split(':', 1) + [CONFIG.defaults['login.port']])[:2]) +- database, path = map(urllib.unquote, +- (urlp.path[1:].split('/', 1) + [None])[:2]) ++ hostname = urllib.unquote(urlp.hostname or ++ CONFIG.defaults['login.server']) ++ port = urlp.port or str(CONFIG.defaults['login.port']) ++ path = urlp.path[1:].split('/', 1) ++ database = urllib.unquote(path.pop(0)) ++ path = path and urllib.unquote(path[0]) or "" + if (not path or + hostname != rpc._HOST or + int(port) != rpc._PORT or +) diff --git a/series b/series index 6ae4471..7949432 100644 --- a/series +++ b/series @@ -26,3 +26,4 @@ issue4421002_20001.diff issue11271002_1.diff disable_tests.diff issue11281003_1.diff +client-open_url.diff