@@ -19,7 +19,7 except ImportError: | |||||
19 | from .forms import CampaignForm, ExperimentForm, DeviceForm, ConfigurationForm, LocationForm, UploadFileForm, DownloadFileForm, OperationForm, NewForm |
|
19 | from .forms import CampaignForm, ExperimentForm, DeviceForm, ConfigurationForm, LocationForm, UploadFileForm, DownloadFileForm, OperationForm, NewForm | |
20 | from .forms import OperationSearchForm, FilterForm, ChangeIpForm |
|
20 | from .forms import OperationSearchForm, FilterForm, ChangeIpForm | |
21 |
|
21 | |||
22 | from .tasks import task_start, task_stop |
|
22 | from .tasks import task_start, task_stop, task_status | |
23 |
|
23 | |||
24 | from apps.rc.forms import RCConfigurationForm, RCLineCode, RCMixConfigurationForm |
|
24 | from apps.rc.forms import RCConfigurationForm, RCLineCode, RCMixConfigurationForm | |
25 | from apps.dds.forms import DDSConfigurationForm |
|
25 | from apps.dds.forms import DDSConfigurationForm | |
@@ -737,10 +737,12 def experiment_start(request, id_exp): | |||||
737 | else: |
|
737 | else: | |
738 | task = task_start.delay(exp.pk) |
|
738 | task = task_start.delay(exp.pk) | |
739 | exp.status = task.wait() |
|
739 | exp.status = task.wait() | |
|
740 | ||||
740 | if exp.status==0: |
|
741 | if exp.status==0: | |
741 | messages.error(request, 'Experiment {} not start'.format(exp)) |
|
742 | messages.error(request, 'Experiment {} not start'.format(exp)) | |
742 | if exp.status==2: |
|
743 | if exp.status==2: | |
743 | messages.success(request, 'Experiment {} started'.format(exp)) |
|
744 | messages.success(request, 'Experiment {} started'.format(exp)) | |
|
745 | task_status.delay(exp.pk) #background get_status function | |||
744 | exp.save() |
|
746 | exp.save() | |
745 |
|
747 | |||
746 | return redirect(exp.get_absolute_url()) |
|
748 | return redirect(exp.get_absolute_url()) |
General Comments 0
You need to be logged in to leave comments.
Login now