Browse Source

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

krish 8 years ago
parent
commit
1cadc97
1 changed files with 1 additions and 1 deletions
  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():