Fix logic for completing builds

- Display better messages to the user, too
This commit is contained in:
Oliver Walters
2021-04-20 15:10:15 +10:00
parent 4420557863
commit 76e2b67f36
6 changed files with 97 additions and 13 deletions

View File

@ -109,8 +109,6 @@ class BuildAutoAllocate(AjaxUpdateView):
build = self.get_object()
form = self.get_form()
context['allocations'] = build.getAutoAllocations()
context['build'] = build
@ -398,8 +396,8 @@ class BuildComplete(AjaxUpdateView):
def validate(self, build, form, **kwargs):
if not build.can_complete:
form.add_error(None, _('Build order cannot be completed'))
if build.incomplete_count > 0:
form.add_error(None, _('Build order cannot be completed - incomplete outputs remain'))
def save(self, build, form, **kwargs):
"""