Browse Source

Cleanup safedelete app

master
Joshua Rubingh 1 year ago
parent
commit
5c5165592e
  1. 2
      VRE/VRE/settings.py
  2. 6
      VRE/apps/openstack/signals.py

2
VRE/VRE/settings.py

@ -40,8 +40,6 @@ INSTALLED_APPS = [ @@ -40,8 +40,6 @@ INSTALLED_APPS = [
'django.contrib.messages',
'django.contrib.staticfiles',
'safedelete',
'apps.api',
'apps.dropoff',
'apps.invitation',

6
VRE/apps/openstack/signals.py

@ -1,11 +1,9 @@ @@ -1,11 +1,9 @@
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.db.models.signals import post_save
from django.db.models.signals import post_save, post_delete
from django.dispatch import receiver
from django.utils import timezone
from safedelete.signals import post_softdelete
from apps.virtual_machine.models import VirtualMachine
from .models import Workspace as OpenStackWorkspace, WorkspacePart as OpenStackWorkspacePart
@ -41,7 +39,7 @@ def create_virtual_machine_openstack(sender, instance, created, **kwargs): @@ -41,7 +39,7 @@ def create_virtual_machine_openstack(sender, instance, created, **kwargs):
# Not a Linux Operating system, so ignore here
pass
@receiver(post_softdelete, sender=VirtualMachine)
@receiver(post_delete, sender=VirtualMachine)
def terminate_virtual_machine(sender, instance, **kwargs):
if hasattr(instance,'workspace_openstack'):
try:

Loading…
Cancel
Save