Oops, paypal donation text was in two places
authorMagnus Hagander <magnus@hagander.net>
Tue, 20 Mar 2018 09:30:48 +0000 (10:30 +0100)
committerMagnus Hagander <magnus@hagander.net>
Tue, 20 Mar 2018 09:30:48 +0000 (10:30 +0100)
Turn it into a settings.py variable instead, so this mistake isn't made
next time.

postgresqleu/paypal/management/commands/paypal_match.py
postgresqleu/paypal/views.py
postgresqleu/settings.py

index b7d813b333cb303084db2d6196107ec81034c659..0fb180bf8246e128726f55a4377b974c833bdfc6 100755 (executable)
@@ -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
index 5a747a2fe6c79fa833b230f9bcb29cfb3ed0e1bc..826a7b86d90306fbdc8bf2d338376f8a9869f02b 100644 (file)
@@ -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()
index f02ab779cba38c3b7e3797c88c97b96815a59368..bec71350f91b7dd82a8d1edccb9d0408d95773a8 100644 (file)
@@ -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/'