reverse order of POST and read, plus remove another raw_post_data

This commit is contained in:
Andy McKay 2012-08-22 16:41:48 -07:00
Родитель 17007e0882
Коммит 6590f20308
1 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -51,7 +51,7 @@ def paypal(request):
def ipn(request):
result = client.post_ipn(data={'data': request.raw_post_data})
result = client.post_ipn(data={'data': request.read()})
paypal_log.info('Solitude IPN returned: %s' % result['status'])
# PayPal could not verify this result.
@ -157,8 +157,8 @@ def _parse_currency(value):
def _paypal(request):
# raw_post_data has to be accessed before request.POST. wtf django?
raw, post = request.read(), request.POST.copy()
# Must be this way around.
post, raw = request.POST.copy(), request.read()
paypal_log.info('IPN received: %s' % raw)
# Check that the request is valid and coming from PayPal.