inveniosoftware/invenio — pull request #2517 by pedrogaudencio (2014-11-12 14:21:36+00:00)
Title: deposit: Checkbox improvements and FileUploadField validation fixes

[[continue](https://github.com/jirikuncar/invenio/pull/312/files#r20167198)] @jirikuncar, I could add the `form.files` to `field.data` in `pre_validation()`, but

```
> json.dumps(form.files)
*** TypeError: {"checksum": "f164caa95a9825b34366392c921486e4", "size": 56629, "id": "a97b2e4e-f349-4c1b-8571-b8e54ed18a17", "name": "file.pdf"} is not JSON serializable
```

Since actually we don't want to save the `DepositionFile` objects from `form.files` in the `field.data` but simply validate them, we could just add that exception there. A different approach could be handle `field.data` in the `FileUploadField` as a bool and assign T/F depending whether there are files or not (and change the validator afterwards)... But I'm not sure about this last one.