Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AlekSIS®
Official
AlekSIS-Core
Commits
b27f2321
Verified
Commit
b27f2321
authored
4 years ago
by
Tom Teichler
Browse files
Options
Downloads
Patches
Plain Diff
Check if registered_tasks() is None
parent
00dec64f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!281
Resolve "Add overview page for celery task results"
Pipeline
#2305
passed
4 years ago
Stage: test
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
aleksis/core/views.py
+6
-5
6 additions, 5 deletions
aleksis/core/views.py
with
6 additions
and
5 deletions
aleksis/core/views.py
+
6
−
5
View file @
b27f2321
...
...
@@ -299,11 +299,12 @@ def system_status(request: HttpRequest) -> HttpResponse:
if
"
django_celery_results
"
in
settings
.
INSTALLED_APPS
:
from
django_celery_results.models
import
TaskResult
# noqa
from
celery.task.control
import
inspect
# noqa
job_list
=
list
(
inspect
().
registered_tasks
().
values
())[
0
]
results
=
[]
for
job
in
job_list
:
results
.
append
(
TaskResult
.
objects
.
filter
(
task_name
=
job
).
last
())
context
[
"
tasks
"
]
=
results
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
())
context
[
"
tasks
"
]
=
results
return
render
(
request
,
"
core/system_status.html
"
,
context
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment