Skip to content

Commit

Permalink
fix(book): Fix description text not formatted
Browse files Browse the repository at this point in the history
  • Loading branch information
seriaati committed Jun 28, 2024
1 parent c83b666 commit a785cf3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ambr/models/book.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from pydantic import BaseModel, Field, field_validator

from ambr.utils import remove_html_tags

__all__ = (
"Book",
"BookDetail",
Expand All @@ -23,6 +25,11 @@ class BookVolume(BaseModel):
description: str
story_id: int = Field(alias="storyId")

@field_validator("description", mode="before")
@classmethod
def __format_description(cls, v: str) -> str:
return remove_html_tags(v)


class BookDetail(BaseModel):
"""
Expand Down

0 comments on commit a785cf3

Please sign in to comment.