diff options
-rw-r--r-- | lib/toaster/toastergui/templates/command_line_builds.html | 6 | ||||
-rw-r--r-- | lib/toaster/toastergui/views.py | 8 |
2 files changed, 13 insertions, 1 deletions
diff --git a/lib/toaster/toastergui/templates/command_line_builds.html b/lib/toaster/toastergui/templates/command_line_builds.html index fcbe80d8d..05db6727e 100644 --- a/lib/toaster/toastergui/templates/command_line_builds.html +++ b/lib/toaster/toastergui/templates/command_line_builds.html @@ -152,7 +152,11 @@ function _ajax_update(file, all, dir){ type: "POST", data: {file: file, all: all, dir: dir}, success:function(data){ - window.location = '/toastergui/builds/' + if (data['response']=='building'){ + location.reload() + } else { + window.location = '/toastergui/builds/' + } }, complete:function(data){ }, diff --git a/lib/toaster/toastergui/views.py b/lib/toaster/toastergui/views.py index 3b5b9f5bd..40aed265d 100644 --- a/lib/toaster/toastergui/views.py +++ b/lib/toaster/toastergui/views.py @@ -2018,6 +2018,14 @@ class CommandLineBuilds(TemplateView): logs_dir = request.POST.get('dir') all_files = request.POST.get('all') + # check if a build is already in progress + if Build.objects.filter(outcome=Build.IN_PROGRESS): + messages.add_message( + self.request, + messages.ERROR, + "A build is already in progress. Please wait for it to complete before starting a new build." + ) + return JsonResponse({'response': 'building'}) imported_files = EventLogsImports.objects.all() try: if all_files == 'true': |