Skip to content

Commit

Permalink
Remove inlines
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewelwell committed Jul 25, 2023
1 parent efb5f4e commit b8afcc4
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions api/task_processor/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,10 @@
)


class TaskRunInline(admin.StackedInline):
model = TaskRun
extra = 0
show_change_link = False


class RecurringTaskRunInline(admin.StackedInline):
model = RecurringTaskRun
extra = 0
show_change_link = False
max_num = 5


@admin.register(RecurringTask)
class RecurringTaskAdmin(admin.ModelAdmin):
inlines = (RecurringTaskRunInline,)
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

0 comments on commit b8afcc4

Please sign in to comment.