Reviewers: ,


Please review this at http://codereview.tryton.org/96001/

Affected files:
  M tryton/common/common.py
  M tryton/gui/main.py


Index: tryton/common/common.py
===================================================================
--- a/tryton/common/common.py
+++ b/tryton/common/common.py
@@ -1024,6 +1024,7 @@
message(_('Concurrency Exception'), msg_type=gtk.MESSAGE_ERROR)
                 return False
         elif exception.faultCode == 'NotLogged':
+            from tryton.gui.main import Main
             if not PLOCK.acquire(False):
                 return False
             hostname = rpc._HOST
@@ -1032,10 +1033,10 @@
                 while True:
                     password = ask(_('Password:'), visibility=False)
                     if password is None:
-                        continue
+                        Main.get_main().sig_logout()
+                        raise Exception('NotLogged')
res = rpc.login(rpc._USERNAME, password, hostname, port,
                             rpc._DATABASE)
-                    from tryton.gui.main import Main
                     Main.get_main().refresh_ssl()
                     if res == -1:
                         message(_('Connection error!\n' \
Index: tryton/gui/main.py
===================================================================
--- a/tryton/gui/main.py
+++ b/tryton/gui/main.py
@@ -967,7 +967,7 @@
             self.menu_screen = None
         return True

-    def sig_logout(self, widget, disconnect=True):
+    def sig_logout(self, widget=None, disconnect=True):
         if not self.close_pages():
             return False
         self.sb_username.set_text('')


--
[email protected] mailing list

Reply via email to