disable cluster settings if WireGuard status cache is not enabled; add validation for cluster mode

This commit is contained in:
Eduardo Silva
2026-01-13 12:22:07 -03:00
parent 3fff8a4e15
commit 72e2e84b34
2 changed files with 9 additions and 0 deletions

View File

@@ -101,6 +101,10 @@ def get_worker(request):
success = False
cluster_settings, created = ClusterSettings.objects.get_or_create(name='cluster_settings')
if not settings.WIREGUARD_STATUS_CACHE_ENABLED and cluster_settings.enabled:
cluster_settings.enabled = False
cluster_settings.save()
if cluster_settings.enabled:
if worker.error_status == 'cluster_disabled':
worker.error_status = ''