Skip to content

Commit

Permalink
Migrate existing session after spiral-project#1082
Browse files Browse the repository at this point in the history
  • Loading branch information
Glandos committed Jul 15, 2023
1 parent 98ed6ac commit 670913a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ihatemoney/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,13 @@ def add_project_id(endpoint, values):
values["project_id"] = g.project.id


@main.url_value_preprocessor
def migrate_session(endpoint, values):
if "projects" in session and isinstance(session["projects"], list):
# Migrate https://github.com/spiral-project/ihatemoney/pull/1082
session["projects"] = {id: name for (id, name) in session["projects"]}


@main.url_value_preprocessor
def set_show_admin_dashboard_link(endpoint, values):
"""Sets the "show_admin_dashboard_link" variable application wide
Expand Down

0 comments on commit 670913a

Please sign in to comment.