Permalink
Browse files

Add unset action for Check Now on product page

  • Loading branch information...
1 parent e8dc226 commit 017c5a8c445f2ce06d5a59cb61186943f9c71787 @nthomas-mozilla nthomas-mozilla committed Aug 21, 2013
Showing with 10 additions and 2 deletions.
  1. +10 −2 apps/mirror/admin.py
View
@@ -37,7 +37,7 @@ class ProductAdmin(admin.ModelAdmin):
list_display = ('name', 'priority', 'count', 'active', 'checknow', 'ssl_only')
list_filter = ('active', 'checknow', 'ssl_only')
ordering = ('name',)
- actions = ('mark_for_checknow',)
+ actions = ('mark_for_checknow', 'unmark_for_checknow')
inlines = [ProductLanguageInline]
def mark_for_checknow(self, request, queryset):
@@ -46,6 +46,14 @@ def mark_for_checknow(self, request, queryset):
msg = "%s project(s) marked for Sentry checking."
self.message_user(request, msg % rows_updated)
+ def unmark_for_checknow(self, request, queryset):
+ """Custom action to unmark a list of products for sentry checking"""
+ rows_updated = queryset.update(checknow=False)
+ msg = "%s project(s) no longer marked for Sentry checking."
+ self.message_user(request, msg % rows_updated)
+
mark_for_checknow.short_description = (
- "Check selected products now with Sentry")
+ "Set Check Now on selected products")
+ unmark_for_checknow.short_description = (
+ "Remove Check Now on selected products")
admin.site.register(Product, ProductAdmin)

0 comments on commit 017c5a8

Please sign in to comment.