mirror of
https://github.com/django/django.git
synced 2025-03-31 11:37:06 +00:00
fix: absolute path test
This commit is contained in:
parent
92c0bced2a
commit
3c4a7560ea
@ -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 []
|
||||
|
Loading…
x
Reference in New Issue
Block a user