소스 검색

HUE-6654 [doc2] Do not fail import when document parent directory is null

krish 8 년 전
부모
커밋
1cadc97
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      desktop/core/src/desktop/api2.py

+ 1 - 1
desktop/core/src/desktop/api2.py

@@ -707,7 +707,7 @@ def _copy_document_with_owner(doc, owner, uuids_map):
 
   # Remap parent directory if needed
   parent_uuid = None
-  if 'parent_directory' in doc['fields']:
+  if doc['fields'].get('parent_directory'):
     parent_uuid = doc['fields']['parent_directory'][0]
 
   if parent_uuid is not None and parent_uuid in uuids_map.keys():