Skip to content

Commit

Permalink
chore(template[DocutilsTemplate]) Fix rare cast inconsistency
Browse files Browse the repository at this point in the history
src/django_docutils/template.py:71: error: Redundant cast to "str"  [redundant-cast]

raises locally, but not on CI (?) even though the system has
the same versions across the board.
  • Loading branch information
tony committed Dec 28, 2024
1 parent 2bef860 commit 51d1d9e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/django_docutils/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,10 @@ def render(
context["csrf_token"] = csrf_token_lazy(request)
context = {"source": self.source, "writer_name": "html"}

return mark_safe(t.cast("str", core.publish_parts(**context)["html_body"]))
parts = core.publish_parts(**context)["html_body"]
assert isinstance(parts, str)

return mark_safe(parts)


register_pygments_directive()

0 comments on commit 51d1d9e

Please sign in to comment.