Browse Source

fix: Use Document in case get_controller raises import errors

(cherry picked from commit a3b79081d6)
version-14
Gavin D'souza 5 years ago
committed by mergify-bot
parent
commit
804e4e212d
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      frappe/core/doctype/doctype/doctype.py

+ 5
- 1
frappe/core/doctype/doctype/doctype.py View File

@@ -109,7 +109,11 @@ class DocType(Document):

from frappe.model.base_document import get_controller

controller = get_controller(self.name)
try:
controller = get_controller(self.name)
except ImportError:
controller = Document

available_objects = {x for x in dir(controller) if isinstance(x, str)}
property_set = {
x for x in available_objects if isinstance(getattr(controller, x, None), property)


Loading…
Cancel
Save