Skip to content

Commit

Permalink
Adds author bio serializer
Browse files Browse the repository at this point in the history
  • Loading branch information
mrharpo committed Jul 2, 2024
1 parent 6185334 commit 40c7db9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions authors/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,15 @@ def name(self):
def image(self):
return self.author.image if self.author else None

@property
def bio(self):
return self.author.bio if self.author else None

Check warning on line 36 in authors/models.py

View check run for this annotation

Codecov / codecov/patch

authors/models.py#L36

Added line #L36 was not covered by tests

api_fields: ClassVar[list[APIField]] = [
APIField('author_id'),
APIField('name'),
APIField('image', serializer=ImageRenditionField('fill-100x100')),
APIField('bio'),
]


Expand Down

0 comments on commit 40c7db9

Please sign in to comment.