[vpn] begin to introduce save() method

The save() and delete() method will create/manage the orders
This commit is contained in:
Nico Schottelius 2020-04-27 18:25:44 +02:00
parent 1cf20a2cb6
commit 62d9ccbbef

View file

@ -173,11 +173,11 @@ class VPNNetwork(Product):
wireguard_public_key = models.CharField(max_length=48)
def save(self, *args, **kwargs):
super().save(*args, **kwargs)
def delete(self, *args, **kwargs):
self.network.status = 'free'
self.network.save()
super().save(*args, **kwargs)
print("deleted {}".format(self))
# managing deletion
# - record free network (?)