mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-04-13 09:42:01 +00:00
11 lines
398 B
Python
11 lines
398 B
Python
![]() |
import datetime
|
||
|
|
||
|
class LastSeenMiddleware(object):
|
||
|
|
||
|
def process_response(self, request, response):
|
||
|
if not request.is_ajax() and request.user.is_authenticated():
|
||
|
request.user.profile.last_seen_on = datetime.datetime.now()
|
||
|
request.user.profile.last_activity_ip = request.META['REMOTE_ADDR']
|
||
|
request.user.profile.save()
|
||
|
|
||
|
return response
|