From a18466c5b58ffbcca36e9834fd713b10265ead29 Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Tue, 27 Apr 2021 10:48:39 +0200 Subject: [PATCH] Optout URL in funding admin export. --- src/funding/admin.py | 7 ++++++- src/funding/models.py | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/funding/admin.py b/src/funding/admin.py index 3e981d8a5..27109e696 100644 --- a/src/funding/admin.py +++ b/src/funding/admin.py @@ -62,7 +62,12 @@ class FundingAdmin(admin.ModelAdmin): 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): diff --git a/src/funding/models.py b/src/funding/models.py index 9907cd017..289ec3379 100644 --- a/src/funding/models.py +++ b/src/funding/models.py @@ -304,6 +304,9 @@ class Funding(models.Model): '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) -- 2.20.1