Commit 805283cf authored by lukas.burgey's avatar lukas.burgey

--wip--

parent 9c7b38da
Pipeline #110856 passed with stage
in 1 minute and 23 seconds
......@@ -228,7 +228,7 @@ def inform_states_about_deletion(sender, instance=None, **kwargs):
_ = kwargs
states = list(instance.states.all())
LOGGER.debug(instance.msg('Deleted deployment still has states: {}'.format(states)))
LOGGER.debug(instance.msg('Informing states about my deletion: {}'.format(states)))
instance.state_target = NOT_DEPLOYED
instance.save()
......@@ -490,8 +490,8 @@ class DeploymentState(models.Model):
# state_target -> state -> transition
state_transitions = {
DEPLOYED: {
DEPLOYED: self.publish_to_client, # the user updated the answers
FAILED: self.publish_to_client, # maybe changed answers solve the problem
DEPLOYED: [DEPLOYMENT_PENDING, self.publish_to_client], # the user updated the answers
FAILED: [DEPLOYMENT_PENDING, self.publish_to_client], # maybe changed answers solve the problem
QUESTIONNAIRE: [DEPLOYMENT_PENDING, self.publish_to_client], # answers were needed for deploying
},
NOT_DEPLOYED: {
......
......@@ -456,11 +456,7 @@ class User(AbstractUser):
def delete(self, using=None, keep_parents=False):
if self.user_type == self.TYPE_CHOICE_USER:
LOGGER.info('Deleting User %s', self)
# TODO
# these deletions are a hack. django should (TM) be able to delete them itself
# but there seems to be a bug
LOGGER.info(self.msg('Preparing user deletion'))
self._delete_deployments()
......@@ -468,9 +464,7 @@ class User(AbstractUser):
for key in self.ssh_keys.all():
key.delete_key()
for state in self.states.all():
state.publish_to_client()
LOGGER.info(self.msg('Deleting right now'))
super().delete(using, keep_parents)
def add_key(self, key):
......
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