Skip to content

django-stubs 1.13.0 compatibility #111

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 15, 2022
Merged
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
8 changes: 4 additions & 4 deletions src/django_idom/http/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ async def web_modules_file(request: HttpRequest, file: str) -> HttpResponse:
# Fetch the file from cache, if available
last_modified_time = os.stat(path).st_mtime
cache_key = f"django_idom:web_module:{str(path).lstrip(str(web_modules_dir))}"
response = await IDOM_CACHE.aget(cache_key, version=last_modified_time) # type: ignore[attr-defined]
response = await IDOM_CACHE.aget(cache_key, version=int(last_modified_time))
if response is None:
async with async_open(path, "r") as fp:
response = HttpResponse(await fp.read(), content_type="text/javascript")
await IDOM_CACHE.adelete(cache_key) # type: ignore[attr-defined]
await IDOM_CACHE.aset( # type: ignore[attr-defined]
cache_key, response, timeout=None, version=last_modified_time
await IDOM_CACHE.adelete(cache_key)
await IDOM_CACHE.aset(
cache_key, response, timeout=None, version=int(last_modified_time)
)
return response

Expand Down