Skip to content

Commit

Permalink
ISPyB LIMS: update 'login_ok' attribute on successful user-type logins
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
elmjag committed Feb 4, 2025
1 parent 812155e commit 542fbea
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mxcubecore/HardwareObjects/UserTypeISPyBLims.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 542fbea

Please sign in to comment.