Skip to content

Commit

Permalink
Making sure that is_anonymous is updated correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
marcus-oscarsson committed Dec 17, 2024
1 parent d06eb36 commit c269326
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions mxcubeweb/core/components/user/usermanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,10 +264,17 @@ def force_signout_user(self, username):
self.app.server.emit("forceSignout", room=socketio_sid, namespace="/hwr")

def login_info(self):
if not current_user.is_anonymous:
session_manager: LimsSessionManager = self.app.lims.get_session_manager()
# update_operator will update the login status of current_user, and make
# sure that the is_anonymous has the correct value.
# Update operator calls lims.select_session that raises an exception if
# there are no valid LIMS sessions.
try:
self.update_operator()
except Exception:
pass

if not current_user.is_anonymous:
session_manager: LimsSessionManager = self.app.lims.get_session_manager()
login_type = (
"User" if HWR.beamline.lims.is_user_login_type() else "Proposal"
)
Expand Down

0 comments on commit c269326

Please sign in to comment.