Skip to content

Commit

Permalink
Quotation._format_position: do not treat page numbers as integers
Browse files Browse the repository at this point in the history
  • Loading branch information
dato committed Apr 8, 2024
1 parent 5105ad7 commit 48beee6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 1 addition & 1 deletion bookwyrm/models/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ def _format_position(self) -> Optional[str]:
end = self.endposition or 0
if self.position_mode != "PG" or not beg:
return None
return f"pp. {beg}-{end}" if end > beg else f"p. {beg}"
return f"pp. {beg}-{end}" if end else f"p. {beg}"

@property
def pure_content(self):
Expand Down
2 changes: 0 additions & 2 deletions bookwyrm/tests/models/test_status_model.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
""" testing models """
from unittest import expectedFailure
from unittest.mock import patch
import pathlib
import re
Expand Down Expand Up @@ -338,7 +337,6 @@ def test_quotation_with_author_to_pure_activity(self, *_):
activity["attachment"][0]["name"], "Author Name: Test Edition (worm)"
)

@expectedFailure
def test_quotation_page_serialization(self, *_):
"""serialization of quotation page position"""
tests = [
Expand Down

0 comments on commit 48beee6

Please sign in to comment.