From 37daabf43cd6670856f0b774584d50d97a54d08c Mon Sep 17 00:00:00 2001 From: Magnus Hagander Date: Tue, 20 Mar 2018 10:30:48 +0100 Subject: [PATCH] Oops, paypal donation text was in two places Turn it into a settings.py variable instead, so this mistake isn't made next time. --- postgresqleu/paypal/management/commands/paypal_match.py | 2 +- postgresqleu/paypal/views.py | 2 +- postgresqleu/settings.py | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/postgresqleu/paypal/management/commands/paypal_match.py b/postgresqleu/paypal/management/commands/paypal_match.py index b7d813b..0fb180b 100755 --- a/postgresqleu/paypal/management/commands/paypal_match.py +++ b/postgresqleu/paypal/management/commands/paypal_match.py @@ -37,7 +37,7 @@ class Command(BaseCommand): # Manual handling of some record types # Record type: donation - if trans.transtext == "PostgreSQL Europe donation": + if trans.transtext == settings.PAYPAL_DONATION_TEXT: trans.setmatched('Donation, automatically matched by script') # Generate a simple accounting record, that will have to be diff --git a/postgresqleu/paypal/views.py b/postgresqleu/paypal/views.py index 5a747a2..826a7b8 100644 --- a/postgresqleu/paypal/views.py +++ b/postgresqleu/paypal/views.py @@ -133,7 +133,7 @@ def paypal_return_handler(request): urls = ["https://www.paypal.com/cgi-bin/webscr?cmd=_view-a-trans&id=%s" % ti.paypaltransid,] # Separate out donations made through our website - if ti.transtext == "PostgreSQL Europe": + if ti.transtext == settings.PAYPAL_DONATION_TEXT: ti.matched = True ti.matchinfo = 'Donation, automatically matched' ti.save() diff --git a/postgresqleu/settings.py b/postgresqleu/settings.py index f02ab77..bec7135 100644 --- a/postgresqleu/settings.py +++ b/postgresqleu/settings.py @@ -154,6 +154,7 @@ PAYPAL_API_PASSWORD='secret' PAYPAL_API_SIGNATURE='secret' PAYPAL_SANDBOX=True PAYPAL_REPORT_RECEIVER='paypal@postgresql.eu' +PAYPAL_DONATION_TEXT="PostgreSQL Europe" # Change whether using sandbox or not ADYEN_BASEURL='https://test.adyen.com/' -- 2.39.5