Skip to content

Commit

Permalink
Validate comment mentions (#10088)
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacsolo authored Oct 16, 2024
1 parent abf3634 commit 95b738c
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ def validate_comment_tx(params: ManageEntityParameters):
f"parent_comment_id {parent_comment_id} must be a number"
)

mentions = params.metadata.get("mentions")
if mentions and not all(isinstance(i, int) for i in mentions):
raise IndexingValidationError(f"Mentions {mentions} must be a list of numbers")


def create_comment(params: ManageEntityParameters):
validate_comment_tx(params)
Expand Down

0 comments on commit 95b738c

Please sign in to comment.