66
77from openwisp_controller .config import settings as app_settings
88
9- from .tasks import fetch_whois_details , manage_approximate_locations
9+ from .tasks import fetch_whois_details , manage_estimated_locations
1010
1111
1212class WHOISService :
@@ -73,16 +73,16 @@ def is_whois_enabled(self):
7373 return getattr (org_settings , "whois_enabled" , app_settings .WHOIS_ENABLED )
7474
7575 @property
76- def is_approximate_location_enabled (self ):
76+ def is_estimated_location_enabled (self ):
7777 """
78- Check if the Approximate location feature is enabled.
78+ Check if the Estimated location feature is enabled.
7979 This does not require to set cache as `is_whois_enabled` already sets it
8080 """
8181 org_settings = cache .get (self .get_cache_key (org_id = self .device .organization .pk ))
8282 return getattr (
8383 org_settings ,
84- "approximate_location_enabled " ,
85- app_settings .APPROXIMATE_LOCATION_ENABLED ,
84+ "estimated_location_enabled " ,
85+ app_settings .ESTIMATED_LOCATION_ENABLED ,
8686 )
8787
8888 def _need_whois_lookup (self , new_ip ):
@@ -105,9 +105,9 @@ def _need_whois_lookup(self, new_ip):
105105
106106 return self .is_whois_enabled
107107
108- def _need_approximate_location_management (self , new_ip ):
108+ def _need_estimated_location_management (self , new_ip ):
109109 """
110- Used to determine if Approximate locations need to be created/updated
110+ Used to determine if Estimated locations need to be created/updated
111111 or not during WHOIS lookup.
112112 """
113113 if not self .is_valid_public_ip_address (new_ip ):
@@ -116,7 +116,7 @@ def _need_approximate_location_management(self, new_ip):
116116 if not self .is_whois_enabled :
117117 return False
118118
119- return self .is_approximate_location_enabled
119+ return self .is_estimated_location_enabled
120120
121121 def get_device_whois_info (self ):
122122 """
@@ -145,10 +145,10 @@ def trigger_whois_lookup(self):
145145 )
146146 # `add_existing` is `True` to handle the case when WHOIS already exists
147147 # as in that case WHOIS lookup is not triggered but we still need to
148- # manage approximate locations.
149- elif self ._need_approximate_location_management (new_ip ):
148+ # manage estimated locations.
149+ elif self ._need_estimated_location_management (new_ip ):
150150 transaction .on_commit (
151- lambda : manage_approximate_locations .delay (
151+ lambda : manage_estimated_locations .delay (
152152 device_pk = self .device .pk , ip_address = new_ip , add_existing = True
153153 )
154154 )
0 commit comments