From 058622556d4b53cb2b450781f6bb0461c0fdcc2f Mon Sep 17 00:00:00 2001 From: Luc Didry Date: Thu, 27 Jun 2024 08:25:42 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20=E2=80=94=20Fix=20bug=20in=20log?= =?UTF-8?q?in=20view=20when=20having=20a=20cookie=20(internal=20server=20e?= =?UTF-8?q?rror)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 2 ++ argos/server/routes/views.py | 2 +- docs/developer/release.md | 6 +++--- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 78c318f..ba0be71 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## [Unreleased] +- 🐛 — Fix bug in login view when having a cookie (internal server error) + ## 0.2.0 Date: 2024-06-24 diff --git a/argos/server/routes/views.py b/argos/server/routes/views.py index 0ca9f87..b889e42 100644 --- a/argos/server/routes/views.py +++ b/argos/server/routes/views.py @@ -30,7 +30,7 @@ SEVERITY_LEVELS = {"ok": 1, "warning": 2, "critical": 3, "unknown": 4} async def login_view(request: Request, msg: str | None = None): token = request.cookies.get("access-token") if token is not None: - manager = get_manager(request) + manager = request.app.state.manager user = await manager.get_current_user(token) if user is not None: return RedirectResponse( diff --git a/docs/developer/release.md b/docs/developer/release.md index db780cc..0947558 100644 --- a/docs/developer/release.md +++ b/docs/developer/release.md @@ -24,13 +24,13 @@ git checkout main make test # Bump the version, according to semantic versionning -hatch version minor # or `hatch version major` +hatch version minor # or `hatch version major`, or `hatch version fix` # Modify the changelog editor CHANGELOG.md # Commit the change -git add argos/__init__.py CHANGELOG +git add argos/__init__.py CHANGELOG.md git commit -m "🏷 — Bump version ($(hatch version))" # Create a tag on the git repository and push it @@ -45,7 +45,7 @@ hatch publish Aditionnaly, ensure it works well in a new environment. -Then go to https://framagit.org/framasoft/framaspace/argos/-/releases to create a new release for the new tag. +Then go to to create a new release for the new tag. Use CHANGELOG.md content for that. ## Bumping the version number