mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-13 06:12:16 +00:00
Trim the IP address
This commit is contained in:
@@ -46,7 +46,7 @@ class IPTrackingMiddleware(object):
|
||||
def process_request(self, request):
|
||||
|
||||
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'])
|
||||
ip, created = SSOUserIPAddress.objects.get_or_create(user=request.user, ip_address=request.META['REMOTE_ADDR'].trim())
|
||||
if not created:
|
||||
ip.last_seen = datetime.utcnow()
|
||||
ip.save()
|
||||
|
||||
Reference in New Issue
Block a user