Replies: 3 comments 1 reply
-
Yes, I encountered this issue as well. When the serializer gathers constraints from the model, it doesn’t account for the fact that a constraint might include a custom error message. Additionally, the |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hi! I face to the same issue. |
Beta Was this translation helpful? Give feedback.
0 replies
-
guys, any news? short workarounds? |
Beta Was this translation helpful? Give feedback.
1 reply
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.
-
Example Model
class UniqueTest(BaseModel):
answer = models.ForeignKey(Answer, on_delete=models.CASCADE)
subject = models.ForeignKey(Subject, on_delete=models.CASCADE)
date = models.DateField()
Sample error response for violation
{
"non_field_errors": [
"The fields answer, subject, date must make a unique set."
]
}
Expected error response
{
"non_field_errors": [
"test error message"
]
}
Beta Was this translation helpful? Give feedback.
All reactions