Skip to content

Commit 4e0ea20

Browse files
author
mn-ram
committed
[fix] Invalidate controller views cache when org context changes
When organization context variables are updated, `bulk_invalidate_config_get_cached_checksum` was called to bust the Config checksum cache, but `invalidate_controller_views_cache` was never called. This left the DeviceChecksumView cache stale, so devices kept receiving the old checksum, never transitioned to `modified` status, and never pulled the updated configuration. Fix: also call `invalidate_controller_views_cache` whenever the org `context` field changes, mirroring the existing behaviour that already fires this task when an organisation is disabled/enabled. Fixes openwisp#1070
1 parent 8cf6733 commit 4e0ea20

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

openwisp_controller/config/base/multitenancy.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
from .. import settings as app_settings
1414
from ..exceptions import OrganizationDeviceLimitExceeded
15-
from ..tasks import bulk_invalidate_config_get_cached_checksum
15+
from ..tasks import bulk_invalidate_config_get_cached_checksum, invalidate_controller_views_cache
1616

1717

1818
class AbstractOrganizationConfigSettings(UUIDModel):
@@ -100,6 +100,7 @@ def save(
100100
bulk_invalidate_config_get_cached_checksum.delay(
101101
{"device__organization_id": str(self.organization_id)}
102102
)
103+
invalidate_controller_views_cache.delay(str(self.organization_id))
103104

104105

105106
class AbstractOrganizationLimits(models.Model):

0 commit comments

Comments
 (0)