Skip to content

Commit

Permalink
Align serializer methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Lxstr committed Apr 18, 2024
1 parent d487b57 commit 182bf53
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## Contributors

- [giuppep](https://github.com/giuppep)
- [eiriklid](https://github.com/eiriklid)
- [necat1](https://github.com/necat1)
- [nebolax](https://github.com/nebolax)
Expand Down
4 changes: 2 additions & 2 deletions src/flask_session/postgresql/postgresql.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,15 @@ def _retrieve_session_data(self, store_id: str) -> Optional[dict]:

if session_data is not None:
serialized_session_data = want_bytes(session_data[0])
return self.serializer.decode(serialized_session_data)
return self.serializer.loads(serialized_session_data)
return None

@retry_query(max_attempts=3)
def _upsert_session(
self, session_lifetime: TimeDelta, session: ServerSideSession, store_id: str
) -> None:

serialized_session_data = self.serializer.encode(session)
serialized_session_data = self.serializer.dumps(session)

if session.sid is not None:
assert session.sid == store_id.removeprefix(self.key_prefix)
Expand Down

0 comments on commit 182bf53

Please sign in to comment.