summaryrefslogtreecommitdiff
path: root/postgresqleu/paypal/views.py
diff options
context:
space:
mode:
authorMagnus Hagander2020-03-29 15:04:46 +0000
committerMagnus Hagander2020-03-29 15:06:49 +0000
commit5df9002dc6133fff57b92ce31f163c52381109ac (patch)
tree81ab05668a5c518baf7faa073b73bbc81b0a6a8e /postgresqleu/paypal/views.py
parentfaf8f525c7516b896e559e8aad385eed3f226a6c (diff)
Remove date parameter to create_accounting_entry
This should always be set to todays date, so set it in the function instaed. This changes the behaviour of the paypal plugin to actually use todays date rather than a date parsed out from the notification. In theory this could change the accounting entry date in case the notification is so delayed it ends up on a different day, but either one could be argued to be equally correct in this case, and using the date of creation of the transaction makes tracking things a lot easier. While at it, clean up some imports that have been missed earlier.
Diffstat (limited to 'postgresqleu/paypal/views.py')
-rw-r--r--postgresqleu/paypal/views.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/postgresqleu/paypal/views.py b/postgresqleu/paypal/views.py
index 06b049e8..f29adbf1 100644
--- a/postgresqleu/paypal/views.py
+++ b/postgresqleu/paypal/views.py
@@ -4,7 +4,6 @@ from django.shortcuts import render, get_object_or_404
from django.conf import settings
from django.utils import timezone
-from datetime import datetime, date
from decimal import Decimal
from urllib.parse import urlencode, unquote_plus
import requests
@@ -152,7 +151,7 @@ def paypal_return_handler(request, methodid):
(pm.config('accounting_fee'), accstr, ti.fee, None),
(settings.ACCOUNTING_DONATIONS_ACCOUNT, accstr, -ti.amount, None),
]
- create_accounting_entry(date.today(), accrows, True, urls)
+ create_accounting_entry(accrows, True, urls)
return render(request, 'paypal/noinvoice.html', {
})