소스 검색

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