Skip to content

Commit 59ff562

Browse files
author
mn-ram
committed
[fix] Invalidate controller views cache when device group context changes
Same issue as org context change: bulk_invalidate_config_get_cached_checksum was called but invalidate_controller_views_cache was not, leaving the DeviceChecksumView cache stale for devices in the group. Fixes #1070
1 parent a3abade commit 59ff562

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

openwisp_controller/config/base/device_group.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@
1515
from .. import settings as app_settings
1616
from ..signals import group_templates_changed
1717
from ..sortedm2m.fields import SortedManyToManyField
18-
from ..tasks import bulk_invalidate_config_get_cached_checksum
18+
from ..tasks import (
19+
bulk_invalidate_config_get_cached_checksum,
20+
invalidate_controller_views_cache,
21+
)
1922
from .config import TemplatesThrough
2023

2124

@@ -88,6 +91,7 @@ def save(
8891
bulk_invalidate_config_get_cached_checksum.delay(
8992
{"device__group_id": str(self.id)}
9093
)
94+
invalidate_controller_views_cache.delay(str(self.organization_id))
9195

9296
def get_context(self):
9397
return deepcopy(self.context)

0 commit comments

Comments
 (0)