# HG changeset patch # User Brian Neal # Date 1246139816 0 # Node ID 9fabeabd89d4c78ca2dad95a0f32c569371f378e # Parent 58bc950c6d8b5cc5e14d178aaf8141700df769a9 Donations: cleaned up logging. Use settings.DONATIONS_DEBUG to decide how to filter on test_ipn records. diff -r 58bc950c6d8b -r 9fabeabd89d4 gpp/donations/models.py --- 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() diff -r 58bc950c6d8b -r 9fabeabd89d4 gpp/donations/views.py --- 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