diff --git a/geomagio/api/db/session_table.py b/geomagio/api/db/session_table.py index 49a62fecfb774c3a96dfb233be7db30097f46a98..61f4b589a0217b5c6ade5f729f8deddd23a33a17 100644 --- a/geomagio/api/db/session_table.py +++ b/geomagio/api/db/session_table.py @@ -24,7 +24,7 @@ async def delete_session(session_id: str) -> None: async def get_session(session_id: str) -> str: query = session.select().where(session.c.session_id == session_id) row = await database.fetch_one(query) - return row.get("data", None) + return row.data async def remove_expired_sessions(max_age: timedelta) -> None: @@ -42,7 +42,7 @@ async def save_session(session_id: str, data: str) -> None: .values(data=data, updated=updated) ) count = await database.execute(query) - if count is None or count == 0: + if count == 0: # no matching session, insert query = session.insert().values( session_id=session_id, data=data, updated=updated