list_display = ['payed_at', 'offer', 'amount', 'name', 'email', 'perk_names']
search_fields = ['name', 'email', 'offer__title', 'offer__author']
list_filter = [PayedFilter, 'offer', PerksFilter]
- actions = [export_as_csv_action()]
+ actions = [export_as_csv_action(
+ fields=[
+ 'id', 'offer', 'name', 'email', 'amount', 'payed_at',
+ 'notifications', 'notify_key', 'wl_optout_url'
+ ]
+ )]
class SpentAdmin(admin.ModelAdmin):
'key': self.notify_key,
}))
+ def wl_optout_url(self):
+ return 'https://wolnelektury.pl' + self.get_disable_notifications_url()
+
def save(self, *args, **kwargs):
if self.email and not self.notify_key:
self.notify_key = get_random_hash(self.email)