mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-22 14:19:28 +00:00
Log first_seen date
This commit is contained in:
@@ -59,5 +59,7 @@ 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.save()
|
||||
|
||||
Reference in New Issue
Block a user