mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-14 14:52:15 +00:00
Fix date/time fuctions for timezone information
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
from django.db import IntegrityError
|
||||
from django.contrib.auth import logout
|
||||
from django.utils.timezone import utc, now
|
||||
|
||||
class InactiveLogoutMiddleware(object):
|
||||
"""
|
||||
@@ -59,7 +60,5 @@ class IPTrackingMiddleware(object):
|
||||
|
||||
if request.user and not request.user.is_anonymous():
|
||||
ip, created = SSOUserIPAddress.objects.get_or_create(user=request.user, ip_address=request.META['REMOTE_ADDR'])
|
||||
if created:
|
||||
ip.first_seen = datetime.utcnow()
|
||||
ip.last_seen = datetime.utcnow()
|
||||
ip.last_seen = now()
|
||||
ip.save()
|
||||
|
||||
Reference in New Issue
Block a user