Skip to content

Commit a2412c5

Browse files
committed
[qa] Formatting
Signed-off-by: DragnEmperor <[email protected]>
1 parent 95fad85 commit a2412c5

File tree

1 file changed

+1
-3
lines changed
  • openwisp_controller/config/whois

1 file changed

+1
-3
lines changed

openwisp_controller/config/whois/tasks.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
import logging
2-
from datetime import timedelta
32

43
import requests
54
from celery import shared_task
65
from django.contrib.gis.geos import Point
76
from django.db import transaction
8-
from django.utils import timezone
97
from django.utils.translation import gettext as _
108
from geoip2 import errors
119
from geoip2 import webservice as geoip2_webservice
@@ -75,7 +73,7 @@ def fetch_whois_details(self, device_pk, initial_ip_address):
7573
new_ip_address = device.last_ip
7674
# If there is existing WHOIS older record then it needs to be updated
7775
whois_obj = WHOISInfo.objects.filter(ip_address=new_ip_address).first()
78-
if whois_obj and (timezone.now() - whois_obj.modified) < timedelta(days=14):
76+
if whois_obj and not device.whois_service.is_older(whois_obj.modified):
7977
return
8078

8179
# Host is based on the db that is used to fetch the details.

0 commit comments

Comments
 (0)