Skip to content

implemented peewee query for term instead of cache - #1801

Open
MImran2002 wants to merge 3 commits into
developmentfrom
termCacheHF
Open

implemented peewee query for term instead of cache#1801
MImran2002 wants to merge 3 commits into
developmentfrom
termCacheHF

Conversation

@MImran2002

Copy link
Copy Markdown
Contributor

Issue Description

Fixes issue #HotFix

  • Fixed an issue where outdated current-term data remained in the user's cookies/session after the database was reset.
  • Previously, even after resetting the database and restarting Flask, the old term information could still appear until the browser cookies were cleared manually.
  • So this causes either the handbook to disappear or still appear.

Changes

  • Changed g.current_term to retrieve the current term directly from the database using the term ID stored in the session.
  • Replaced:
    dict_to_model(Term, session['current_term'])
    with:
    Term.get_by_id(session["current_term"])
  • This prevents term model data from being reused from the session and ensures the application loads the current database term record.

Testing

  • Navigate to AdminSettingsTerm Management.
  • Upload the required handbook and confirm the information appears correctly.
  • Reset the database.
  • Restart the application using flask run.
  • Refresh the browser without clearing cookies.
  • Confirm that the old information no longer remains after the database reset.
  • Verified that manually clearing browser cookies is no longer required for the information to update correctly.

@MImran2002
MImran2002 requested a review from BrianRamsay August 27, 2026 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants