Warning
This document is for an old release of Galaxy. You can alternatively view this page in the latest release if it exists or view the top of the latest release's documentation.
Source code for galaxy.managers.session
from sqlalchemy import (
and_,
true,
)
from sqlalchemy.orm import (
joinedload,
)
[docs]class GalaxySessionManager:
"""Manages GalaxySession."""
[docs] def get_session_from_session_key(self, session_key: str):
"""Returns GalaxySession if session_key is valid."""
galaxy_session = self.model.session.query(self.model.GalaxySession).filter(
and_(
self.model.GalaxySession.table.c.session_key == session_key,
self.model.GalaxySession.table.c.is_valid == true())
).options(joinedload("user")).first()
return galaxy_session