Fix bug whne try to open the client with an URL

This commit is contained in:
Bernat Brunet Torruella 2014-05-25 08:02:29 +02:00
parent b7e89dfb71
commit 19b3399d0f
2 changed files with 22 additions and 0 deletions

21
client-open_url.diff Normal file
View File

@ -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
)

1
series
View File

@ -26,3 +26,4 @@ issue4421002_20001.diff
issue11271002_1.diff
disable_tests.diff
issue11281003_1.diff
client-open_url.diff