Commit edd43b08 authored by lukas.burgey's avatar lukas.burgey
Browse files

Publish more changes to the DepStates

parent 8fa1b254
Pipeline #110805 passed with stage
in 1 minute and 34 seconds
......@@ -414,7 +414,6 @@ class DeploymentState(models.Model):
return state, created
# adds the deployment to our related deployments
def bind_to_deployment(self, deployment):
if not self.deployments.filter(
......@@ -507,20 +506,20 @@ class DeploymentState(models.Model):
REJECTED: None, # client will not execute the deployment
FAILED: None, # the client will retry this deployment via polling
FAILED_PERMANENTLY: None, # the client will retry this deployment when it restarts
QUESTIONNAIRE: self.publish_to_user, # needs answers
QUESTIONNAIRE: None, # needs answers
DEPLOYED: [REMOVAL_PENDING, self.publish_to_user, self.publish_to_client], # needs to get removed
DEPLOYMENT_PENDING: [NOT_DEPLOYED, self.publish_to_user], # aborting a deployment
DEPLOYED: [REMOVAL_PENDING, self.publish_to_client], # needs to get removed
DEPLOYMENT_PENDING: NOT_DEPLOYED, # aborting a deployment
NOT_DEPLOYED: None, # already reached correct state
REMOVAL_PENDING: None, # already on the way to the correct state
# these four states indicate that the last deployment run was not successful
# we therefore can turn around an say that the we reached the NOT_DEPLOYED state
FAILED: [NOT_DEPLOYED, self.publish_to_user],
FAILED_PERMANENTLY: [NOT_DEPLOYED, self.publish_to_user],
REJECTED: [NOT_DEPLOYED, self.publish_to_user],
QUESTIONNAIRE: [NOT_DEPLOYED, self.publish_to_user],
......@@ -594,6 +593,8 @@ class DeploymentState(models.Model):
self.publish_to_user() # always publish to the use when the state changes
def publish_to_user(self):
if self.user is None:
LOGGER.debug(self.msg('publish_to_user: 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