From 87ec6d4fb9c56f11795cbd9b7e5c4334a3dda7b6 Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Mon, 30 May 2022 10:41:08 +0530 Subject: [PATCH] fix: initialize link_tables in constructor --- frappe/model/db_query.py | 2 +- frappe/tests/test_db_query.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frappe/model/db_query.py b/frappe/model/db_query.py index dd7227df47..3013483ca9 100644 --- a/frappe/model/db_query.py +++ b/frappe/model/db_query.py @@ -34,6 +34,7 @@ class DatabaseQuery(object): def __init__(self, doctype, user=None): self.doctype = doctype self.tables = [] + self.link_tables = [] self.conditions = [] self.or_conditions = [] self.fields = None @@ -131,7 +132,6 @@ class DatabaseQuery(object): self.run = run self.strict = strict self.ignore_ddl = ignore_ddl - self.link_tables = [] # for contextual user permission check # to determine which user permission is applicable on link field of specific doctype diff --git a/frappe/tests/test_db_query.py b/frappe/tests/test_db_query.py index df518ce3cb..c1b2e05266 100644 --- a/frappe/tests/test_db_query.py +++ b/frappe/tests/test_db_query.py @@ -53,7 +53,7 @@ class TestReportview(unittest.TestCase): def test_link_field_syntax(self): todo = frappe.get_doc( - doctype="ToDo", description=f"Test ToDo", allocated_to="Administrator" + doctype="ToDo", description="Test ToDo", allocated_to="Administrator" ).insert() result = frappe.db.get_all( "ToDo",