diff --git a/beat/web/experiments/models.py b/beat/web/experiments/models.py index c9480bc1dea89d07238f35face67ae5f3ce763c8..67af2255bfce850fe4562d33b4997a5a86ee0f47 100644 --- a/beat/web/experiments/models.py +++ b/beat/web/experiments/models.py @@ -549,10 +549,13 @@ class Experiment(Shareable): # Ties the block in slots = job_description.get('nb_slots') - b, _ = Block.objects.get_or_create(experiment=self, - name=block_name, algorithm=algorithm) + b = Block.objects.filter(experiment=self, name=block_name).first() + if b is None: + b = Block(experiment=self, name=block_name, algorithm=algorithm) + else: + b.algorithm = algorithm b.command=simplejson.dumps(job_description, indent=4) - b.status=Block.NOT_CACHED if (self.status == Experiment.PENDING) else b.status + b.status=Block.NOT_CACHED b.analyzer=algorithm.analysis() b.environment=env b.queue=queue