Skip to content

Commit 6cb4ba6

Browse files
committed
[qa] Minor formatting
Signed-off-by: DragnEmperor <[email protected]>
1 parent 592eb3a commit 6cb4ba6

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

openwisp_controller/config/admin.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1364,9 +1364,8 @@ class ConfigSettingsInline(admin.StackedInline):
13641364

13651365
def get_fields(self, request, obj=None):
13661366
fields = super().get_fields(request, obj)
1367-
# hide the 'who_is_enabled' field if WhoIs is not Configured
13681367
if not app_settings.WHO_IS_CONFIGURED:
1369-
fields = [f for f in fields if f != "who_is_enabled"]
1368+
fields.remove("who_is_enabled")
13701369
return fields
13711370

13721371
OrganizationAdmin.save_on_top = True

openwisp_controller/config/base/device.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ class Meta:
120120

121121
def __init__(self, *args, **kwargs):
122122
super().__init__(*args, **kwargs)
123-
# if WhoIs is configured, we need to look out for changes
124-
# in last_ip field as well
123+
# Initial value for last_ip is required in WhoIs
124+
# to remove WhoIs info related to that ip address.
125125
if app_settings.WHO_IS_CONFIGURED:
126126
self._changed_checked_fields.append("last_ip")
127127

@@ -286,7 +286,6 @@ def save(self, *args, **kwargs):
286286
self.key = self.generate_key(shared_secret)
287287
state_adding = self._state.adding
288288
super().save(*args, **kwargs)
289-
# WhoIs Lookup runs only when WhoIs is configured.
290289
if app_settings.WHO_IS_CONFIGURED:
291290
self._check_last_ip()
292291
if state_adding and self.group and self.group.templates.exists():

0 commit comments

Comments
 (0)