From 764370f3c60bb905435779fb4d1d9efebdc9271a Mon Sep 17 00:00:00 2001 From: Sagar Vora Date: Sat, 29 Oct 2022 12:04:52 +0000 Subject: [PATCH] fix: set proper cache key for singles when name is passed as `None` (#18667) [skip ci] --- frappe/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe/__init__.py b/frappe/__init__.py index ad07b11caf..c03b87be1c 100644 --- a/frappe/__init__.py +++ b/frappe/__init__.py @@ -1115,7 +1115,7 @@ def can_cache_doc(args) -> str | None: return doctype = args[0] - name = doctype if len(args) == 1 else args[1] + name = doctype if len(args) == 1 or args[1] is None else args[1] # Only cache if both doctype and name are strings if isinstance(doctype, str) and isinstance(name, str):