From 7f11ccb4516f576dcc27865debfa82e6f040758a Mon Sep 17 00:00:00 2001 From: Noelle Leigh <5957867+noelleleigh@users.noreply.github.com> Date: Fri, 17 May 2024 14:20:58 -0400 Subject: [PATCH 1/2] Storage: url() only accepts a string as a parameter --- django-stubs/core/files/storage.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django-stubs/core/files/storage.pyi b/django-stubs/core/files/storage.pyi index e9566d6a6..69438da29 100644 --- a/django-stubs/core/files/storage.pyi +++ b/django-stubs/core/files/storage.pyi @@ -17,7 +17,7 @@ class Storage: def exists(self, name: str) -> bool: ... def listdir(self, path: str) -> tuple[list[str], list[str]]: ... def size(self, name: str) -> int: ... - def url(self, name: str | None) -> str: ... + def url(self, name: str) -> str: ... def get_accessed_time(self, name: str) -> datetime: ... def get_created_time(self, name: str) -> datetime: ... def get_modified_time(self, name: str) -> datetime: ... From 916178f1ce195879ebc8c3fd899fe15fe3e38f8f Mon Sep 17 00:00:00 2001 From: Noelle Leigh <5957867+noelleleigh@users.noreply.github.com> Date: Fri, 17 May 2024 14:21:43 -0400 Subject: [PATCH 2/2] default_storage: instance of Storage Maybe `LazyObject` should be generic? --- django-stubs/core/files/storage.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django-stubs/core/files/storage.pyi b/django-stubs/core/files/storage.pyi index 69438da29..08debb018 100644 --- a/django-stubs/core/files/storage.pyi +++ b/django-stubs/core/files/storage.pyi @@ -44,6 +44,6 @@ class FileSystemStorage(Storage): class DefaultStorage(LazyObject): ... -default_storage: Any +default_storage: Storage def get_storage_class(import_path: str | None = ...) -> type[Storage]: ...