Skip to content
Snippets Groups Projects
Commit b70ae4fb authored by André Anjos's avatar André Anjos :speech_balloon: Committed by André Anjos
Browse files

[utils] Reset experiments in a transient state after a restore (c.f. #433)

parent 0f56e113
No related branches found
No related tags found
No related merge requests found
......@@ -46,6 +46,7 @@ import django.core.serializers.base
from django.contrib.auth.models import User
from ....navigation.models import Agreement
from ....accounts.models import AccountSettings
from ....experiments.models import Experiment, Block
_original_save = django.core.serializers.base.DeserializedObject.save
......@@ -152,3 +153,9 @@ class Command(BaseCommand):
# removes the temporary directory
shutil.rmtree(tmpdir)
# reset all experiments in a transient state (notice Job and
# JobSplit are not backed-up because of circular dependence issues
# on the "experiments" app).
transient = (Experiment.RUNNING, Experiment.CANCELING)
for e in Experiment.objects.filter(status__in=transient): e.reset()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment