comparison gpp/donations/views.py @ 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 5899e308cdb3
children a3b47d0f4df1
comparison
equal deleted inserted replaced
64:58bc950c6d8b 65:9fabeabd89d4
136 txn_type = params.get('txn_type') 136 txn_type = params.get('txn_type')
137 if txn_type != 'web_accept': 137 if txn_type != 'web_accept':
138 logging.warning('IPN: invalid txn_type: %s' % txn_type) 138 logging.warning('IPN: invalid txn_type: %s' % txn_type)
139 return 139 return
140 140
141 logging.debug('web_accept')
142
143 # Looks like a donation, save it to the database. 141 # Looks like a donation, save it to the database.
144 # Determine which user this came from, if any. 142 # Determine which user this came from, if any.
145 # The username is stored in the custom field if the user was logged in when 143 # The username is stored in the custom field if the user was logged in when
146 # the donation was made. 144 # the donation was made.
147 user = None 145 user = None
148 if 'custom' in params: 146 if 'custom' in params and params['custom']:
149 try: 147 try:
150 user = User.objects.get(username__exact=params['custom']) 148 user = User.objects.get(username__exact=params['custom'])
151 except User.DoesNotExist: 149 except User.DoesNotExist:
152 logging.debug('user does not exist')
153 pass 150 pass
154 151
155 is_anonymous = item_number == settings.DONATIONS_ITEM_ANON_NUM 152 is_anonymous = item_number == settings.DONATIONS_ITEM_ANON_NUM
156 test_ipn = params.get('test_ipn') == '1' 153 test_ipn = params.get('test_ipn') == '1'
157 154