From bc715bbb2c0ca34f5918092e00680d1cab094d75 Mon Sep 17 00:00:00 2001 From: Noelle Leigh <5957867+noelleleigh@users.noreply.github.com> Date: Fri, 17 May 2024 17:43:50 -0400 Subject: [PATCH] `django.core.files.storage`: Improvements (#243) - `Storage`: `url()` only accepts a string as a parameter. - `default_storage`: instance of `Storage` as far as usage is concerned. --- django-stubs/core/files/storage.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/django-stubs/core/files/storage.pyi b/django-stubs/core/files/storage.pyi index e9566d6a6..08debb018 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: ... @@ -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]: ...