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

HUE-9266 [history] Allow to fetch the history for all the type of queries

Romain 6 жил өмнө
parent
commit
3970d457cc

+ 2 - 1
apps/jobbrowser/src/jobbrowser/apis/history.py

@@ -27,6 +27,7 @@ from notebook.api import _get_statement
 from notebook.models import Notebook
 
 from jobbrowser.apis.base_api import Api
+from jobbrowser.conf import MAX_JOB_FETCH
 
 
 LOG = logging.getLogger(__name__)
@@ -35,7 +36,7 @@ LOG = logging.getLogger(__name__)
 class HistoryApi(Api):
 
   def apps(self, filters):
-    tasks = Document2.objects.get_history(doc_type='query-hive', user=self.user)
+    tasks = Document2.objects.get_history(user=self.user).order_by('-last_modified')[:MAX_JOB_FETCH.get()]
     apps = []
 
     for app in tasks: