Эх сурвалжийг харах

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

krish 9 жил өмнө
parent
commit
59a32fa193

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

@@ -179,7 +179,7 @@ def massaged_documents_for_json(documents, user):
 
 
   for document in documents:
   for document in documents:
     try:
     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:
     except:
       LOG.exception('failed to get absolute url')
       LOG.exception('failed to get absolute url')
       # If app of document is disabled
       # If app of document is disabled