From 3c4a7560eaaeea06e7c30cd6ed90c49c22bfe980 Mon Sep 17 00:00:00 2001 From: almaz amanzholuly Date: Sun, 24 Mar 2024 12:23:59 +0500 Subject: [PATCH] fix: absolute path test --- django/core/checks/caches.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/django/core/checks/caches.py b/django/core/checks/caches.py index bd28ec5076..0e469d4f96 100644 --- a/django/core/checks/caches.py +++ b/django/core/checks/caches.py @@ -58,16 +58,16 @@ def check_file_based_cache_is_absolute(app_configs, **kwargs): for alias, config in settings.CACHES.items(): if config.get("BACKEND").endswith("FileBasedCache"): alias_name = alias - location = config + location = config.get("LOCATION") if ( - alias_name is not None - and not pathlib.Path(location.get("LOCATION")).is_absolute() + location is not None + and not pathlib.Path(location).is_absolute() ): - return Warning( + return [Warning( f"Your '{alias_name}' cache LOCATION path is relative. Use an " f"absolute path instead.", id="caches.W003", - ) + )] return []