Skip to content

Commit

Permalink
Added admin action "resend_signals"
Browse files Browse the repository at this point in the history
  • Loading branch information
Sureiya committed Nov 14, 2013
1 parent e25b2f9 commit 9900b22
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion django_clickbank/admin.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from django.contrib import admin
from django_clickbank.models import Notification, Post
from django_clickbank.forms import PostAdminForm

from django.conf import settings

class NotificationAdmin(admin.ModelAdmin):

Expand All @@ -12,6 +12,18 @@ class NotificationAdmin(admin.ModelAdmin):
list_filter = ['transaction_type', 'transaction_date', 'verification_passed']
readonly_fields = ['post_data']

def resend_signals(self, request, queryset):
"""
Resend signals for notifications. This should probably only be used to debug
your application.
"""
for notification in queryset:
notification.send_signals()

resend_signals.short_description = 'Resend django signals for selected notifications'

if settings.CLICKBANK_DEBUG:
actions = [resend_signals]

class PostAdmin(admin.ModelAdmin):

Expand Down

0 comments on commit 9900b22

Please sign in to comment.