Stop the login loop after network error and add error message
This commit is contained in:
1 parent
8a1ca40f95
commit
1f5d0f746e
2 files changed
+8
No files matched your search
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user