Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ Improvements
set to the result of calling ``render_block_to_string()``. Contributed by
`@gogognome <https://github.com/gogognome>`_. (`#60 <https://github.com/clokep/django-render-block/pull/60>`_)

Bugfixes
--------

* Fix incorrect type hints. Contributed by `@ma11011s <https://github.com/ma11011s>`_. (`#58 <https://github.com/clokep/django-render-block/pull/58>`_)

Maintenance
-----------

Expand Down
10 changes: 5 additions & 5 deletions render_block/base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import List, Optional, Tuple, Union
from typing import Any, Mapping, Optional, Sequence, Union

from django.http import HttpRequest, HttpResponse
from django.template import Context, loader
Expand All @@ -18,9 +18,9 @@ class Jinja2Template: # type: ignore[no-redef]


def render_block_to_string(
template_name: Union[str, Tuple[str], List[str]],
template_name: Union[str, Sequence[str]],
block_name: str,
context: Optional[Context] = None,
context: Optional[Union[Context, Mapping[str, Any]]] = None,
request: Optional[HttpRequest] = None,
) -> str:
"""
Expand Down Expand Up @@ -62,9 +62,9 @@ def render_block_to_string(

def render_block(
request: HttpRequest,
template_name: str,
template_name: Union[str, Sequence[str]],
block_name: str,
context: Optional[Context] = None,
context: Optional[Union[Context, Mapping[str, Any]]] = None,
content_type: Optional[str] = None,
status: Optional[int] = None,
) -> HttpResponse:
Expand Down