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

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

parent 44f1c051
No related branches found
No related tags found
1 merge request!198[utils] Reset experiments in a transient state after a restore (c.f. #433)
Pipeline #
...@@ -46,6 +46,7 @@ import django.core.serializers.base ...@@ -46,6 +46,7 @@ import django.core.serializers.base
from django.contrib.auth.models import User from django.contrib.auth.models import User
from ....navigation.models import Agreement from ....navigation.models import Agreement
from ....accounts.models import AccountSettings from ....accounts.models import AccountSettings
from ....experiments.models import Experiment, Block
_original_save = django.core.serializers.base.DeserializedObject.save _original_save = django.core.serializers.base.DeserializedObject.save
...@@ -152,3 +153,9 @@ class Command(BaseCommand): ...@@ -152,3 +153,9 @@ class Command(BaseCommand):
# removes the temporary directory # removes the temporary directory
shutil.rmtree(tmpdir) 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