Skip to content

Commit

Permalink
Improve richt text html field validator
Browse files Browse the repository at this point in the history
  • Loading branch information
bkis committed Dec 23, 2024
1 parent a8630f6 commit 05c80b4
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions Tekst-API/tekst/resources/rich_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,9 @@ class RichTextContent(ContentBase):
Field(description="Last used editor mode for this content"),
] = "wysiwyg"

@field_validator("html", mode="before")
@field_validator("html", mode="after")
@classmethod
def validate_html(cls, value) -> str:
if not isinstance(value, str):
value = str(value)
return sanitize_html(value)


Expand Down

0 comments on commit 05c80b4

Please sign in to comment.