1
0
Fork 0

test_quotation_page_serialization: add test with no position

This commit is contained in:
Adeodato Simó 2024-04-08 16:15:50 -03:00
parent df78cc64a6
commit 8733369605
No known key found for this signature in database
GPG key ID: 98EF291323013F6E
2 changed files with 7 additions and 5 deletions

View file

@ -392,7 +392,7 @@ class Quotation(BookStatus):
def _format_position(self) -> Optional[str]:
"""serialize page position"""
beg = self.position
end = self.endposition or 0
end = self.endposition
if self.position_mode != "PG" or not beg:
return None
return f"pp. {beg}-{end}" if end else f"p. {beg}"