mirror of
https://github.com/dkmstr/openuds.git
synced 2025-01-08 21:18:00 +03:00
Fixed servicepool deletion on image deletion
This commit is contained in:
parent
7d26463639
commit
b69f56ecb8
@ -187,9 +187,6 @@ class Image(UUIDModel):
|
|||||||
:note: If destroy raises an exception, the deletion is not taken.
|
:note: If destroy raises an exception, the deletion is not taken.
|
||||||
'''
|
'''
|
||||||
toDelete = kwargs['instance']
|
toDelete = kwargs['instance']
|
||||||
toDelete.deployedServices.update(image=None)
|
|
||||||
|
|
||||||
# Todelete is a group
|
|
||||||
|
|
||||||
logger.debug('Deleted image {0}'.format(toDelete))
|
logger.debug('Deleted image {0}'.format(toDelete))
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
__updated__ = '2015-02-01'
|
__updated__ = '2015-03-24'
|
||||||
|
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from django.db.models import signals
|
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 = models.CharField(max_length=1, default=State.ACTIVE, db_index=True)
|
||||||
state_date = models.DateTimeField(default=NEVER)
|
state_date = models.DateTimeField(default=NEVER)
|
||||||
show_transports = models.BooleanField(default=True)
|
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)
|
initial_srvs = models.PositiveIntegerField(default=0)
|
||||||
cache_l1_srvs = models.PositiveIntegerField(default=0)
|
cache_l1_srvs = models.PositiveIntegerField(default=0)
|
||||||
cache_l2_srvs = models.PositiveIntegerField(default=0)
|
cache_l2_srvs = models.PositiveIntegerField(default=0)
|
||||||
|
Loading…
Reference in New Issue
Block a user