Skip to content

Conversation

@leifurhauks
Copy link

Description

Failing test that demonstrates a validation inconsistency -- the implicit ManyToMany field on a model serializer, with required=False, fails when the input data is a QueryDict and the ManyToMany field is omitted; but succeeds for a plain dict.

@xordoquy
Copy link
Contributor

xordoquy commented Mar 3, 2017

The Model's field needs to have blank=True. You'll notice that the serializer doesn't complain about the lack of the field. It complains about the field being blank.
At first sight, this is a side effect of forms that can't set a value to null.

@xordoquy xordoquy closed this Mar 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants