From a17a9a1dd4e77daf04e1c4be0a6ed7045bc9513d Mon Sep 17 00:00:00 2001 From: Elmir Jagudin Date: Fri, 17 Jan 2025 16:28:23 +0100 Subject: [PATCH] ISPyB LIMS: update 'login_ok' attribute on successful user-type logins The self.login_ok attribute is consulted in ISPyBAbstractLIMS.is_connected() method. The lims.is_connected() method is used by the rest of the system to check if LIMS sub-system is in usable state. --- mxcubecore/HardwareObjects/UserTypeISPyBLims.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mxcubecore/HardwareObjects/UserTypeISPyBLims.py b/mxcubecore/HardwareObjects/UserTypeISPyBLims.py index b8a20242ab..af4957085c 100644 --- a/mxcubecore/HardwareObjects/UserTypeISPyBLims.py +++ b/mxcubecore/HardwareObjects/UserTypeISPyBLims.py @@ -100,16 +100,16 @@ def login(self, loginID, psd, ldap_connection=None) -> LimsSessionManager: logging.getLogger("HWR").debug( "Starting LDAP authentication %s" % login_name ) - ok = self.ldap_login(login_name, psd, ldap_connection) + self.login_ok = self.ldap_login(login_name, psd, ldap_connection) msg = loginID logging.getLogger("HWR").debug("User %s logged in LDAP" % login_name) elif self.authServerType == "ispyb": logging.getLogger("HWR").debug("ISPyB login") - ok, msg = self.ispyb_login(login_name, psd) + self.login_ok, msg = self.ispyb_login(login_name, psd) else: raise Exception("Authentication server type is not defined") - if not ok: + if not self.login_ok: msg = "%s." % msg.capitalize() # refuse Login logging.getLogger("HWR").error("ISPyB login not ok")