Skip to content
Snippets Groups Projects
Verified Commit 4bdfb167 authored by Jonathan Weth's avatar Jonathan Weth :keyboard:
Browse files

Merge branch 'fix/show-tasks-on-system-status' into mix/conn-dne

parents 120c9753 f86baf3e
Branches mix/conn-dne
No related tags found
No related merge requests found
......@@ -368,6 +368,7 @@ class SystemStatus(MainView, PermissionRequiredMixin):
def get(self, request, *args, **kwargs):
status_code = 500 if self.errors else 200
task_results = []
if "django_celery_results" in settings.INSTALLED_APPS:
from django_celery_results.models import TaskResult # noqa
......@@ -375,11 +376,10 @@ class SystemStatus(MainView, PermissionRequiredMixin):
if inspect().registered_tasks():
job_list = list(inspect().registered_tasks().values())[0]
results = []
for job in job_list:
results.append(TaskResult.objects.filter(task_name=job).last())
task_results.append(TaskResult.objects.filter(task_name=job).order_by("date_done").last())
context = {"plugins": self.plugins, "status_code": status_code}
context = {"plugins": self.plugins, "status_code": status_code, "tasks": task_results}
return self.render_to_response(context, status=status_code)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment