Replies: 4 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 |
0 replies
|
Hi! I face to the same issue. |
0 replies
|
guys, any news? short workarounds? |
1 reply
|
I have a very similar situation to the one described, with the difference that I have a Unfortunately, in #9766, this case was not taken into account. |
0 replies
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"
]
}
All reactions