2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-01 19:20:55 +00:00

Move validation to the model class

This commit is contained in:
Oliver
2021-11-28 22:29:01 +11:00
parent 4ee55847f1
commit 78309c1915
3 changed files with 17 additions and 18 deletions

View File

@ -88,6 +88,12 @@ function loadAttachmentTable(url, options) {
link: {},
comment: {},
},
processResults: function(data, fields, opts) {
// Remove the "link" field if the attachment is a file!
if (data.attachment) {
delete opts.fields.link;
}
},
onSuccess: reloadAttachmentTable,
title: '{% trans "Edit Attachment" %}',
});