mirror of
https://github.com/eduardogsilva/wireguard_webadmin.git
synced 2025-08-26 13:21:14 +00:00
create and manage peer groups
This commit is contained in:
19
wireguard/migrations/0024_alter_peergroup_uuid.py
Normal file
19
wireguard/migrations/0024_alter_peergroup_uuid.py
Normal file
@@ -0,0 +1,19 @@
|
||||
# Generated by Django 5.1.5 on 2025-01-20 13:53
|
||||
|
||||
import uuid
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('wireguard', '0023_peergroup'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='peergroup',
|
||||
name='uuid',
|
||||
field=models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False),
|
||||
),
|
||||
]
|
@@ -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)
|
||||
|
Reference in New Issue
Block a user