Commit ad23e6dc authored by lukas.burgey's avatar lukas.burgey

Fix publishing

parent 4f96e5ba
Pipeline #110847 failed with stage
in 1 minute and 28 seconds
......@@ -180,6 +180,7 @@ class VODeployment(Deployment):
if created:
LOGGER.debug(deployment.msg('Created'))
LOGGER.debug('VO has services: %s', vo.services.all())
for service in vo.services.all():
DeploymentState.get_or_create(user, service, deployment)
......@@ -215,6 +216,7 @@ class ServiceDeployment(Deployment):
if created:
LOGGER.debug(deployment.msg('Created'))
LOGGER.debug('Service exists: %s', service)
DeploymentState.get_or_create(user, service, deployment)
return deployment
......@@ -430,12 +432,11 @@ class DeploymentState(models.Model):
self.audit_log_response()
LOGGER.debug(self.msg('Patched by client: {} - {}'.format(self.state, self.message)))
self.publish_to_user()
if self.state == NOT_DEPLOYED and self.is_orphaned:
# publish one last time so the webpage displays "not_deployed"
self.publish_to_user()
LOGGER.debug(self.msg('Deleting'))
# don't delete 'self' but the DepState via its id
DeploymentState.objects.get(id=self.id).delete()
return
......@@ -559,6 +560,8 @@ class DeploymentState(models.Model):
self.save()
self.publish_to_user() # always publish to the use when the state changes
else:
LOGGER.debug(self.msg('State unchanged: {}'.format(self.state)))
def publish_to_user(self):
if self.user is None:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment