From ea206e071d4ee754d2d3cce48e684c73feddfe6e Mon Sep 17 00:00:00 2001 From: Eero Vilpponen Date: Fri, 3 Oct 2025 09:05:15 +0300 Subject: [PATCH 1/2] Keep query parameters in redirect url --- src/django_session_timeout/middleware.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/django_session_timeout/middleware.py b/src/django_session_timeout/middleware.py index bda7fcb..884cf0a 100644 --- a/src/django_session_timeout/middleware.py +++ b/src/django_session_timeout/middleware.py @@ -29,10 +29,11 @@ def process_request(self, request): if session_is_expired: request.session.flush() redirect_url = getattr(settings, "SESSION_TIMEOUT_REDIRECT", None) + full_path = request.get_full_path() if redirect_url: return redirect(redirect_url) else: - return redirect_to_login(next=request.path) + return redirect_to_login(next=full_path) expire_since_last_activity = getattr( settings, "SESSION_EXPIRE_AFTER_LAST_ACTIVITY", False From d4c303c9f2666f5b3eeebaa085e5cb00ccbdd5e1 Mon Sep 17 00:00:00 2001 From: Eero Vilpponen Date: Fri, 3 Oct 2025 09:13:31 +0300 Subject: [PATCH 2/2] Bump version --- .bumpversion.cfg | 2 +- CHANGES | 5 +++++ docs/conf.py | 4 ++-- setup.py | 2 +- src/django_session_timeout/__init__.py | 2 +- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 5e51fb7..58af01b 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.1.0 +current_version = 0.1.1 commit = true tag = true tag_name = {new_version} diff --git a/CHANGES b/CHANGES index dcc765e..65c5ffc 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,8 @@ +0.1.1 (2025-10-03) +------------------ + - Include query parameters in redirect + + 0.1.0 (2020-03-08) ------------------ - Add SESSION_TIMEOUT_REDIRECT to set a custom URL for redirect users which diff --git a/docs/conf.py b/docs/conf.py index 2428f0d..669e8f1 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -56,7 +56,7 @@ # |version| and |release|, also used in various other places throughout the # built documents. # -version = '0.1.0' +version = '0.1.1' release = version # The language for content autogenerated by Sphinx. Refer to documentation @@ -139,7 +139,7 @@ # The name for this set of Sphinx documents. # " v documentation" by default. # -# html_title = u'django-session-timeout v0.1.0' +# html_title = u'django-session-timeout v0.1.1' # A shorter title for the navigation bar. Default is the same as html_title. # diff --git a/setup.py b/setup.py index ac456b4..4645173 100644 --- a/setup.py +++ b/setup.py @@ -27,7 +27,7 @@ setup( name="django-session-timeout", - version="0.1.0", + version="0.1.1", description="Middleware to expire sessions after specific amount of time", long_description=long_description, long_description_content_type="text/markdown", diff --git a/src/django_session_timeout/__init__.py b/src/django_session_timeout/__init__.py index 3dc1f76..485f44a 100644 --- a/src/django_session_timeout/__init__.py +++ b/src/django_session_timeout/__init__.py @@ -1 +1 @@ -__version__ = "0.1.0" +__version__ = "0.1.1"