mirror of
https://github.com/eduardogsilva/wireguard_webadmin.git
synced 2026-01-02 06:36:16 +00:00
update cluster settings to enforce WireGuard requirements during test phase
This commit is contained in:
@@ -141,6 +141,7 @@ class ClusterSettingsForm(forms.ModelForm):
|
||||
cleaned_data = super().clean()
|
||||
stats_sync_interval = cleaned_data.get('stats_sync_interval')
|
||||
stats_cache_interval = cleaned_data.get('stats_cache_interval')
|
||||
primary_enable_wireguard = cleaned_data.get('primary_enable_wireguard')
|
||||
|
||||
if stats_sync_interval and stats_sync_interval < 60:
|
||||
raise ValidationError(_("Stats sync interval must be at least 60 seconds."))
|
||||
@@ -148,4 +149,7 @@ class ClusterSettingsForm(forms.ModelForm):
|
||||
if stats_cache_interval and stats_cache_interval < 60:
|
||||
raise ValidationError(_("Stats cache interval must be at least 60 seconds."))
|
||||
|
||||
if not primary_enable_wireguard:
|
||||
raise ValidationError(_("Disabling WireGuard on the master server is currently not supported."))
|
||||
|
||||
return cleaned_data
|
||||
Reference in New Issue
Block a user