Fix wrong login by setting _USER to None instead of root for issue1702
This commit is contained in:
1 parent
f52995f794
commit
d5616e1f37
1 file changed
+4
-4
+4
-4
@@ -9,7 +9,7 @@ from tryton.fingerprints import Fingerprints
|
||||
from tryton.config import get_config_dir
|
||||
|
||||
_SOCK = None
|
||||
_USER = 0
|
||||
_USER = None
|
||||
_USERNAME = ''
|
||||
_SESSION = ''
|
||||
_DATABASE = ''
|
||||
@@ -141,11 +141,11 @@ def login(username, password, host, port, database):
|
||||
_SOCK.reconnect()
|
||||
except (socket.error, RuntimeError):
|
||||
pass
|
||||
_USER = 0
|
||||
_USER = None
|
||||
_SESSION = ''
|
||||
return -1
|
||||
if not res:
|
||||
_USER = 0
|
||||
_USER = None
|
||||
_SESSION = ''
|
||||
return -2
|
||||
_USER = res[0]
|
||||
@@ -174,7 +174,7 @@ def logout():
|
||||
pass
|
||||
_SOCK.disconnect()
|
||||
_SOCK = None
|
||||
_USER = 0
|
||||
_USER = None
|
||||
_USERNAME = ''
|
||||
_SESSION = ''
|
||||
_DATABASE = ''
|
||||
|
||||
Reference in new issue
Block a user