Skip to content

Commit

Permalink
[fix] Fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pandafy committed Nov 13, 2024
1 parent c821a2f commit c6927eb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions openwisp_monitoring/device/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ class DeviceMetricView(
queryset = (
DeviceData.objects.filter(organization__is_active=True)
.only(
'_is_deactivated',
'id',
'key',
)
Expand Down
5 changes: 5 additions & 0 deletions openwisp_monitoring/device/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,11 @@ def connect_device_signals(self):
sender=Device,
dispatch_uid='device_deactivated_update_devicemonitoring',
)
device_deactivated.connect(
DeviceMetricView.invalidate_get_device_cache,
sender=Device,
dispatch_uid=('device_deactivated_invalidate_view_device_cache'),
)

@classmethod
def device_post_save_receiver(cls, instance, created, **kwargs):
Expand Down

0 comments on commit c6927eb

Please sign in to comment.