From 62d9ccbbef06706dcb7467d693ba31d732c882a7 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 27 Apr 2020 18:25:44 +0200 Subject: [PATCH] [vpn] begin to introduce save() method The save() and delete() method will create/manage the orders --- uncloud_django_based/uncloud/uncloud_net/models.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/uncloud_django_based/uncloud/uncloud_net/models.py b/uncloud_django_based/uncloud/uncloud_net/models.py index 26a6eb8..8dfff05 100644 --- a/uncloud_django_based/uncloud/uncloud_net/models.py +++ b/uncloud_django_based/uncloud/uncloud_net/models.py @@ -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 (?)