Commit 95e1914a authored by Lukas Burgey's avatar Lukas Burgey

Fix a minor issue

parent f2d47896
......@@ -272,10 +272,10 @@ class NewDeployment(models.Model):
# each state item publishes its state to the user
def user_remove(self):
self._set_target('not_deployed')
for item in self.state_items.all():
if item.state != NOT_DEPLOYED:
item.user_remove()
self._set_target('not_deployed')
self.publish_to_client()
# each state item publishes its state to the user
......@@ -450,7 +450,7 @@ class NewDeploymentStateItem(models.Model):
def user_remove(self):
if self.parent.state_target == DEPLOYED and (self.state == FAILED or self.state == REJECTED):
self._reset()
self._set_state(NOT_DEPLOYED)
self._set_state(NOT_DEPLOYED, publish=False)
return
if self.state == NOT_DEPLOYED:
......@@ -519,11 +519,6 @@ class NewDeploymentStateItem(models.Model):
return '[DSItem:{}] {}'.format(self, msg)
def _set_state(self, state, publish=True):
if self.state == 'rejected':
LOGGER.info('refusing to change state of rejected state_item')
self.save()
return
self.state = state
self.save()
LOGGER.debug(self.msg('state: '+self.state))
......
......@@ -39,9 +39,9 @@ class NewDeploymentStateItemSerializer(serializers.ModelSerializer):
class Meta:
model = models.NewDeploymentStateItem
fields = [
'state',
'id',
'site',
'state',
'questionnaire',
'credentials',
'service',
......
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