浏览代码

HUE-5075 [core] Call get_absolute_url() only when document content object has the attribute

krish 9 年之前
父节点
当前提交
59a32fa193
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      desktop/core/src/desktop/api.py

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

@@ -179,7 +179,7 @@ def massaged_documents_for_json(documents, user):
 
   for document in documents:
     try:
-      url = document.content_object.get_absolute_url()
+      url = document.content_object and hasattr(document.content_object, 'get_absolute_url') and document.content_object.get_absolute_url() or ''
     except:
       LOG.exception('failed to get absolute url')
       # If app of document is disabled