Skip to content

Commit 883d888

Browse files
authored
Change reswap() type hint for method to str (#422)
1 parent 4b0adcc commit 883d888

File tree

2 files changed

+5
-13
lines changed

2 files changed

+5
-13
lines changed

docs/changelog.rst

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
Changelog
33
=========
44

5+
* Change ``reswap()`` type hint for ``method`` to ``str``.
6+
7+
Thanks to Dan Jacob for the report in `Issue #421 <https://github.com/adamchainz/django-htmx/issues/421>`__ and fix in `PR #422 <https://github.com/adamchainz/django-htmx/pull/422>`__.
8+
59
1.17.2 (2023-11-16)
610
-------------------
711

src/django_htmx/http.py

+1-13
Original file line numberDiff line numberDiff line change
@@ -93,19 +93,7 @@ def push_url(response: _HttpResponse, url: str | Literal[False]) -> _HttpRespons
9393
return response
9494

9595

96-
def reswap(
97-
response: _HttpResponse,
98-
method: Literal[
99-
"innerHTML",
100-
"outerHTML",
101-
"beforebegin",
102-
"afterbegin",
103-
"beforeend",
104-
"afterend",
105-
"delete",
106-
"none",
107-
],
108-
) -> _HttpResponse:
96+
def reswap(response: _HttpResponse, method: str) -> _HttpResponse:
10997
response["HX-Reswap"] = method
11098
return response
11199

0 commit comments

Comments
 (0)