-
-
Notifications
You must be signed in to change notification settings - Fork 287
[fix] Skip WHOIS and estimated location for deactivated devices #1325 #1340
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
77e8413
b9666e5
a7b9842
efea089
8d528e7
6ace436
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -210,6 +210,8 @@ def process_ip_data_and_location(self, force_lookup=False): | |
| Trigger WHOIS lookup based on the conditions of `_need_whois_lookup`. | ||
| Tasks are triggered on commit to ensure redundant data is not created. | ||
| """ | ||
| if self.device.is_deactivated(): | ||
| return | ||
|
Comment on lines
+213
to
+214
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Check whether the estimated_location service also has a deactivation guard,
# since issue `#1325` requires both WHOIS and Estimated Location to be skipped.
fd -t f 'service\.py$' openwisp_controller/geo/estimated_location --exec cat {} \;
echo "---"
# Look for any is_deactivated / _is_deactivated usage inside estimated_location
rg -nP -C3 '(is_deactivated|_is_deactivated)' openwisp_controller/geo/estimated_locationRepository: openwisp/openwisp-controller Length of output: 5427 Estimated Location service is missing the deactivation guard—fix is incomplete. The WHOIS service guard is correct: However, issue Add an 🤖 Prompt for AI Agents |
||
| new_ip = self.device.last_ip | ||
| initial_ip = self.device._initial_last_ip | ||
| if force_lookup or self._need_whois_lookup(new_ip): | ||
|
|
@@ -229,6 +231,8 @@ def update_whois_info(self): | |
| when the data is older than | ||
| ``OPENWISP_CONTROLLER_WHOIS_REFRESH_THRESHOLD_DAYS``. | ||
| """ | ||
| if self.device.is_deactivated(): | ||
| return | ||
| ip_address = self.device.last_ip | ||
| if not self.is_valid_public_ip_address(ip_address): | ||
| return | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.