fixup! Enforce MAX_COMMENT_DEPTH in discussion_api
Add more extensive testing
This commit is contained in:
@@ -303,7 +303,7 @@ class CommentSerializer(_ContentSerializer):
|
||||
"parent_id does not identify a comment in the thread identified by thread_id."
|
||||
)
|
||||
if is_comment_too_deep(parent):
|
||||
raise ValidationError({"parent_id": ["Parent is too deep."]})
|
||||
raise ValidationError({"parent_id": ["Comment level is too deep."]})
|
||||
return attrs
|
||||
|
||||
def restore_object(self, attrs, instance=None):
|
||||
|
||||
Reference in New Issue
Block a user