2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-20 05:46:34 +00:00

Fix error message styles for API errors

- django ValidationError uses "__all__" key for non_field_errors
- whyyyyyyyyyyyy
This commit is contained in:
Oliver Walters
2021-08-05 00:15:55 +10:00
parent 408ff639dd
commit 2cb0b448b7
2 changed files with 38 additions and 3 deletions

View File

@ -173,7 +173,32 @@ function editPart(pk, options={}) {
title: '{% trans "Edit Part" %}',
reload: true,
});
}
function duplicatePart(pk, options={}) {
// First we need all the part information
inventreeGet(`/api/part/${pk}/`, {}, {
success: function(response) {
var fields = partFields({
duplicate: true
});
constructForm('{% url "api-part-list" %}', {
method: 'POST',
fields: fields,
title: '{% trans "Duplicate Part" %}',
data: response,
onSuccess: function(data) {
// Follow the new part
location.href = `/part/${data.pk}/`;
}
});
}
});
}