From 9e0276bf2ba382f415b9b80ec3c9a6acd8f1149b Mon Sep 17 00:00:00 2001 From: Alexander Brill Date: Wed, 2 Mar 2016 22:16:42 +0100 Subject: [PATCH 1/2] Fix #62 Catch TypeError when converting string to time This happens when upgrading from old versions and we have old sessions that has some old time formats. --- session_security/utils.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/session_security/utils.py b/session_security/utils.py index 72ed287..a0dbccc 100644 --- a/session_security/utils.py +++ b/session_security/utils.py @@ -34,3 +34,6 @@ def get_last_activity(session): ################################################################# return datetime.now() + except TypeError: + return datetime.now() + From 96dd92eca0ad75eaef44c71bdc8339fd7e255e31 Mon Sep 17 00:00:00 2001 From: DT <406266+dethorpecs@users.noreply.github.com> Date: Tue, 13 Aug 2019 16:08:41 -0700 Subject: [PATCH 2/2] Update quick.rst to new-style middleware The new style middleware setting is described here: https://docs.djangoproject.com/en/1.10/topics/http/middleware/ --- docs/source/quick.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/quick.rst b/docs/source/quick.rst index 6094a86..6249c22 100644 --- a/docs/source/quick.rst +++ b/docs/source/quick.rst @@ -14,7 +14,7 @@ For static file service, add to ``settings.INSTALLED_APPS``:: 'session_security', -Add to ``settings.MIDDLEWARE_CLASSES``, **after** django's AuthenticationMiddleware:: +Add this line in ``settings.MIDDLEWARE_CLASSES`` on djanog 1.8+ or ``settings.MIDDLEWARE`` on django 1.10+, **after** django's AuthenticationMiddleware:: 'session_security.middleware.SessionSecurityMiddleware',