Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor session to follow wrapper class pattern #2800

Open
angela-tran opened this issue Mar 28, 2025 · 0 comments
Open

Refactor session to follow wrapper class pattern #2800

angela-tran opened this issue Mar 28, 2025 · 0 comments

Comments

@angela-tran
Copy link
Member

angela-tran commented Mar 28, 2025

The Benefits app currently encapsulates interaction with the Django session framework via the benefits.core.session module, which contains:

  • functions to retrieve session data
  • a single update function to update session data
  • some other helper functions.

This module serves as the single place where all session-handling logic is done, and we've noticed this is becoming harder to work with.

A new pattern was established in Office-of-Digital-Services/django-cdt-identity that follows a more class-based approach.

In the same spirit as #2778 and #2777, i.e. in the spirit of having smaller, more specific, self-contained and cohesive organization, we want to refactor the current session module into the new pattern. This could allow us to make use of inheritance or other language features to better organize the interaction with request.session. The Session in Office-of-Digital-Services/cdt-ods-disaster-recovery is an example of this.

Acceptance Criteria

  • [ ]

Additional context

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Needs shaping
Development

No branches or pull requests

1 participant