Peer list with details

This commit is contained in:
Eduardo Silva
2024-02-17 11:53:51 -03:00
parent 0a14192444
commit cfcabed244
13 changed files with 207 additions and 8 deletions

View File

@@ -30,6 +30,9 @@ class PeerAllowedIPForm(forms.ModelForm):
priority = cleaned_data.get('priority')
allowed_ip = cleaned_data.get('allowed_ip')
netmask = cleaned_data.get('netmask')
if allowed_ip is None:
raise forms.ValidationError("Please provide a valid IP address.")
wireguard_network = ipaddress.ip_network(f"{self.current_peer.wireguard_instance.address}/{self.current_peer.wireguard_instance.netmask}", strict=False)
if priority == 0: