1
0
mirror of https://github.com/dkmstr/openuds.git synced 2024-12-22 13:34:04 +03:00

Fixed servicepool deletion on image deletion

This commit is contained in:
Adolfo Gómez García 2015-03-24 11:22:28 +01:00
parent 7d26463639
commit b69f56ecb8
2 changed files with 2 additions and 5 deletions

View File

@ -187,9 +187,6 @@ class Image(UUIDModel):
:note: If destroy raises an exception, the deletion is not taken.
'''
toDelete = kwargs['instance']
toDelete.deployedServices.update(image=None)
# Todelete is a group
logger.debug('Deleted image {0}'.format(toDelete))

View File

@ -33,7 +33,7 @@
from __future__ import unicode_literals
__updated__ = '2015-02-01'
__updated__ = '2015-03-24'
from django.db import models
from django.db.models import signals
@ -75,7 +75,7 @@ class DeployedService(UUIDModel):
state = models.CharField(max_length=1, default=State.ACTIVE, db_index=True)
state_date = models.DateTimeField(default=NEVER)
show_transports = models.BooleanField(default=True)
image = models.ForeignKey(Image, null=True, blank=True, related_name='deployedServices')
image = models.ForeignKey(Image, null=True, blank=True, related_name='deployedServices', on_delete=models.SET_NULL)
initial_srvs = models.PositiveIntegerField(default=0)
cache_l1_srvs = models.PositiveIntegerField(default=0)
cache_l2_srvs = models.PositiveIntegerField(default=0)