Skip to content

Commit

Permalink
Update views.py
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbernick committed Jul 23, 2015
1 parent 4d31b0b commit 386d27d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion session_security/views.py
Expand Up @@ -6,6 +6,7 @@
from django.contrib import auth
from django.views import generic
from django import http
from django.shortcuts import redirect

from .utils import get_last_activity

Expand All @@ -21,7 +22,7 @@ class PingView(generic.View):
def get(self, request, *args, **kwargs):
if '_session_security' not in request.session:
# It probably has expired already
return http.HttpResponse('logout')
return redirect('/login/logout/')

last_activity = get_last_activity(request.session)
inactive_for = (datetime.now() - last_activity).seconds
Expand Down

0 comments on commit 386d27d

Please sign in to comment.