mirror of
https://github.com/eduardogsilva/wireguard_webadmin.git
synced 2025-08-30 22:59:30 +02:00
create and manage peer groups
This commit is contained in:
parent
797058b29b
commit
eefc573c61
9 changed files with 222 additions and 11 deletions
|
@ -129,12 +129,5 @@ class PeerGroup(models.Model):
|
|||
|
||||
created = models.DateTimeField(auto_now_add=True)
|
||||
updated = models.DateTimeField(auto_now=True)
|
||||
uuid = models.UUIDField(primary_key=True, editable=False)
|
||||
uuid = models.UUIDField(primary_key=True, editable=False, default=uuid.uuid4)
|
||||
|
||||
def clean(self):
|
||||
if self.peer.exists() and self.server_instance.exists():
|
||||
raise ValidationError("Please choose either WireGuard Instances or Peers, not both.")
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
self.clean()
|
||||
super().save(*args, **kwargs)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue