Allow builds to be completed without any outputs (#3518)

* Remove form validation error if no build outputs are created

* Remove check before launching build-complete form
This commit is contained in:
Oliver 2022-08-11 12:46:33 +10:00 committed by GitHub
parent 1010a6296f
commit 427404b3ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 15 deletions

View File

@ -546,9 +546,6 @@ class BuildCompleteSerializer(serializers.Serializer):
if build.incomplete_count > 0:
raise ValidationError(_("Build order has incomplete outputs"))
if not build.has_build_outputs():
raise ValidationError(_("No build outputs have been created for this build order"))
return data
def save(self):

View File

@ -224,23 +224,11 @@ src="{% static 'img/blank_image.png' %}"
});
$("#build-complete").on('click', function() {
{% if build.incomplete_count > 0 %}
showAlertDialog(
'{% trans "Incomplete Outputs" %}',
'{% trans "Build Order cannot be completed as incomplete build outputs remain" %}',
{
alert_style: 'danger',
}
);
{% else %}
completeBuildOrder({{ build.pk }}, {
overallocated: {% if build.has_overallocated_parts %}true{% else %}false{% endif %},
allocated: {% if build.are_untracked_parts_allocated %}true{% else %}false{% endif %},
completed: {% if build.remaining == 0 %}true{% else %}false{% endif %},
});
{% endif %}
});
{% if report_enabled %}