fixup! Enforce MAX_COMMENT_DEPTH in discussion_api

Add more extensive testing
This commit is contained in:
Greg Price
2015-06-19 12:48:11 -04:00
parent f47ab2bb18
commit 7fcf4e3d8d
2 changed files with 31 additions and 13 deletions

View File

@@ -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):