From 1f5d0f746ef5d774580a1bb3f88f0ab29675f81e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 14 Aug 2008 11:22:52 +0200 Subject: [PATCH] Stop the login loop after network error and add error message --- tryton/common/common.py | 4 ++++ tryton/gui/window/tree.py | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/tryton/common/common.py b/tryton/common/common.py index 5db63f7d30..9e1e62ef34 100644 --- a/tryton/common/common.py +++ b/tryton/common/common.py @@ -593,6 +593,10 @@ def process_exception(exception, parent, obj='', method='', *args): if password is None: raise Exception('NotLogged') res = rpc.login(rpc._USERNAME, password, host, port, rpc._DATABASE) + if res == -1: + message(_('Connection error!\n' \ + 'Unable to connect to the server!'), parent) + return False if res < 0: continue if obj and method: diff --git a/tryton/gui/window/tree.py b/tryton/gui/window/tree.py index 97bf3e0b4e..63c4549382 100644 --- a/tryton/gui/window/tree.py +++ b/tryton/gui/window/tree.py @@ -278,6 +278,10 @@ class Tree(SignalEvent): return True res = rpc.login(rpc._USERNAME, password, host, port, rpc._DATABASE) + if res == -1: + common.message(_('Connection error!\n' \ + 'Unable to connect to the server!'), self.window) + return True if res < 0: continue return False