Skip to content
Browse files

Admin actions to reset and disable jobs.

  • Loading branch information...
1 parent cccfb1a commit 5e37bb06472603877c28dcb4ba0652dc0aee8aed Tim Graham committed Mar 23, 2011
Showing with 7 additions and 0 deletions.
  1. +7 −0 chronograph/admin.py
View
7 chronograph/admin.py
@@ -57,6 +57,7 @@ def clean(self):
return cleaned_data
class JobAdmin(admin.ModelAdmin):
+ actions = ['disable_jobs', 'reset_jobs']
form = JobForm
list_display = (
'job_success', 'name', 'last_run_with_link', 'next_run', 'get_timeuntil',
@@ -83,6 +84,12 @@ class JobAdmin(admin.ModelAdmin):
}),
)
+ def disable_jobs(self, request, queryset):
+ return queryset.update(disabled=True)
+
+ def reset_jobs(self, request, queryset):
+ return queryset.update(is_running=False)
+
def last_run_with_link(self, obj):
format = get_date_formats()[1]
value = capfirst(dateformat.format(obj.last_run, format))

0 comments on commit 5e37bb0

Please sign in to comment.
Something went wrong with that request. Please try again.