diff options
| -rw-r--r-- | bitbake/lib/toaster/toastergui/templates/command_line_builds.html | 6 | ||||
| -rw-r--r-- | bitbake/lib/toaster/toastergui/views.py | 8 |
2 files changed, 13 insertions, 1 deletions
diff --git a/bitbake/lib/toaster/toastergui/templates/command_line_builds.html b/bitbake/lib/toaster/toastergui/templates/command_line_builds.html index fcbe80d8d1..05db6727e7 100644 --- a/bitbake/lib/toaster/toastergui/templates/command_line_builds.html +++ b/bitbake/lib/toaster/toastergui/templates/command_line_builds.html | |||
| @@ -152,7 +152,11 @@ function _ajax_update(file, all, dir){ | |||
| 152 | type: "POST", | 152 | type: "POST", |
| 153 | data: {file: file, all: all, dir: dir}, | 153 | data: {file: file, all: all, dir: dir}, |
| 154 | success:function(data){ | 154 | success:function(data){ |
| 155 | window.location = '/toastergui/builds/' | 155 | if (data['response']=='building'){ |
| 156 | location.reload() | ||
| 157 | } else { | ||
| 158 | window.location = '/toastergui/builds/' | ||
| 159 | } | ||
| 156 | }, | 160 | }, |
| 157 | complete:function(data){ | 161 | complete:function(data){ |
| 158 | }, | 162 | }, |
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py index 3b5b9f5bd9..40aed265dc 100644 --- a/bitbake/lib/toaster/toastergui/views.py +++ b/bitbake/lib/toaster/toastergui/views.py | |||
| @@ -2018,6 +2018,14 @@ class CommandLineBuilds(TemplateView): | |||
| 2018 | logs_dir = request.POST.get('dir') | 2018 | logs_dir = request.POST.get('dir') |
| 2019 | all_files = request.POST.get('all') | 2019 | all_files = request.POST.get('all') |
| 2020 | 2020 | ||
| 2021 | # check if a build is already in progress | ||
| 2022 | if Build.objects.filter(outcome=Build.IN_PROGRESS): | ||
| 2023 | messages.add_message( | ||
| 2024 | self.request, | ||
| 2025 | messages.ERROR, | ||
| 2026 | "A build is already in progress. Please wait for it to complete before starting a new build." | ||
| 2027 | ) | ||
| 2028 | return JsonResponse({'response': 'building'}) | ||
| 2021 | imported_files = EventLogsImports.objects.all() | 2029 | imported_files = EventLogsImports.objects.all() |
| 2022 | try: | 2030 | try: |
| 2023 | if all_files == 'true': | 2031 | if all_files == 'true': |
