Merge pull request #10578 from scmmishra/count-fix-develop

fix: don't cache zero count
This commit is contained in:
Shivam Mishra 2020-06-04 05:15:47 +00:00 committed by GitHub
commit 6fee3b9dfd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -183,8 +183,8 @@ class Workspace:
def _doctype_contains_a_record(name):
exists = self.table_counts.get(name, None)
if exists is None:
if not frappe.db.get_value('DocType', name, 'issingle', cache=True):
if not exists:
if not frappe.db.get_value('DocType', name, 'issingle'):
exists = frappe.db.count(name)
else:
exists = True