UniqueTogetherValidator fails validating conditional auto_now datetime constraint on 3.16.1 #9792
Unanswered
julian-rachmann
asked this question in
Potential Issue
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have a model that defines a UniqueConstraint with a condition using a DateTime field with
auto_now_add=True
:When validating the model using a ModelSerializer, the validation fails with
{"created": ["This field is required."]}
on create.From what I can tell, the issue seems to be that
enforce_required_fields
onUniqueTogetherValidator
is not taking into account any defaults that the model might be supplying.Beta Was this translation helpful? Give feedback.
All reactions