[Do not merge yet] Used validations on the model data. Request for comments #111
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
These changes have helped me! Some code has been added to make sure that the file objects are not returned when even one validation fails. This was something I was expecting to be there as a developer. So, I was working on a case where I have to prevent the user from uploading more than 4 documents, I was happy to find the maxnum attribute I though that It won't let the user select more than 4 docs, or at the very least will return with an empty model, that was not the case though. But after these changes, it works as expected, if the user selects any files that violate the validation conditions it will return with an
[]in case of multiselect and withnullin case of single file select.