Mercurial > public > sg101
changeset 65:9fabeabd89d4
Donations: cleaned up logging. Use settings.DONATIONS_DEBUG to decide how to filter on test_ipn records.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sat, 27 Jun 2009 21:56:56 +0000 |
parents | 58bc950c6d8b |
children | 9a29e9933959 |
files | gpp/donations/models.py gpp/donations/views.py |
diffstat | 2 files changed, 2 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/gpp/donations/models.py Sat Jun 27 21:44:52 2009 +0000 +++ b/gpp/donations/models.py Sat Jun 27 21:56:56 2009 +0000 @@ -30,7 +30,7 @@ qs = self.filter(payment_date__year=year, payment_date__month=month, - test_ipn=False).select_related('user') + test_ipn=settings.DONATIONS_DEBUG).select_related('user') gross = decimal.Decimal() net = decimal.Decimal()
--- a/gpp/donations/views.py Sat Jun 27 21:44:52 2009 +0000 +++ b/gpp/donations/views.py Sat Jun 27 21:56:56 2009 +0000 @@ -138,18 +138,15 @@ logging.warning('IPN: invalid txn_type: %s' % txn_type) return - logging.debug('web_accept') - # Looks like a donation, save it to the database. # Determine which user this came from, if any. # The username is stored in the custom field if the user was logged in when # the donation was made. user = None - if 'custom' in params: + if 'custom' in params and params['custom']: try: user = User.objects.get(username__exact=params['custom']) except User.DoesNotExist: - logging.debug('user does not exist') pass is_anonymous = item_number == settings.DONATIONS_ITEM_ANON_NUM