I want to find a simple way to notify users about a new release note without using django-notifications or adding a relation between user and release notes table in the database, using something like a flag that returns true once a new release note is added but i don't know if its possible to use session to check if user has already seen the release note or not.

1 Answers

Daniel Hepper On

Sessions are probably not a good solution for your problem:

  1. Depending on your session backend, accessing sessions outside of a request is hard (DB backend) or downright impossible (cookie backend).
  2. When a user logs out, the session is lost.
  3. A user can have multiple sessions.

If you are fine with users seeing release notes multiple times, storing the date/id of the last release note seen in the session could work.

The most reliable approach is a ReleaseNoteHistory table where you store either the date of or a reference to the last release note the user has seen.