refactor: getattr

Co-authored-by: gavin <gavin18d@gmail.com>
This commit is contained in:
Raffael Meyer 2021-05-12 20:54:06 +02:00 committed by GitHub
parent cb21e9de84
commit aa06b63eb6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -107,7 +107,7 @@ def import_doc(docdict, force=False, data_import=False, pre_process=None,
doc = frappe.get_doc(docdict)
if hasattr(doc.meta, 'is_tree') and getattr(doc.meta, 'is_tree'):
if getattr(doc.meta, 'is_tree', None):
doc.lft = None
doc.rgt = None