From ae70029b51baa4684e5a555777ab37f562a64880 Mon Sep 17 00:00:00 2001 From: Archmonger <16909269+Archmonger@users.noreply.github.com> Date: Mon, 14 Nov 2022 18:21:20 -0800 Subject: [PATCH] django-stubs 1.13.0 compatibility --- src/django_idom/http/views.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/django_idom/http/views.py b/src/django_idom/http/views.py index 262634f9..57233bab 100644 --- a/src/django_idom/http/views.py +++ b/src/django_idom/http/views.py @@ -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