-
Notifications
You must be signed in to change notification settings - Fork 429
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: rendering recurring task admin times out (#2514)
- Loading branch information
1 parent
24c21ea
commit cb95a92
Showing
1 changed file
with
9 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,18 @@ | ||
from django.contrib import admin | ||
|
||
from task_processor.models import ( | ||
RecurringTask, | ||
RecurringTaskRun, | ||
Task, | ||
TaskRun, | ||
) | ||
|
||
|
||
class TaskRunInline(admin.StackedInline): | ||
model = TaskRun | ||
extra = 0 | ||
show_change_link = False | ||
|
||
|
||
class RecurringTaskRunInline(admin.StackedInline): | ||
model = RecurringTaskRun | ||
extra = 0 | ||
show_change_link = False | ||
from task_processor.models import RecurringTask | ||
|
||
|
||
@admin.register(RecurringTask) | ||
class RecurringTaskAdmin(admin.ModelAdmin): | ||
inlines = (RecurringTaskRunInline,) | ||
list_display = ("uuid", "task_identifier", "run_every", "last_run_status") | ||
list_display = ( | ||
"uuid", | ||
"task_identifier", | ||
"run_every", | ||
"last_run_status", | ||
"is_locked", | ||
) | ||
readonly_fields = ("args", "kwargs") | ||
|
||
def last_run_status(self, instance: Task) -> str: | ||
def last_run_status(self, instance: RecurringTask) -> str: | ||
return instance.task_runs.order_by("-started_at").first().result |
cb95a92
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
docs – ./docs
docs.flagsmith.com
docs.bullet-train.io
docs-git-main-flagsmith.vercel.app
docs-flagsmith.vercel.app
cb95a92
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
flagsmith-frontend-preview – ./frontend
flagsmith-frontend-preview-git-main-flagsmith.vercel.app
flagsmith-frontend-preview-flagsmith.vercel.app
flagsmith-frontend-production-native.vercel.app
cb95a92
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
flagsmith-frontend-staging – ./frontend
flagsmith-staging-frontend.vercel.app
flagsmith-frontend-staging-git-main-flagsmith.vercel.app
flagsmith-frontend-staging-flagsmith.vercel.app
staging.flagsmith.com