This commit is contained in:
Tanner Collin 2021-12-22 06:25:02 +00:00
parent 6b76057cab
commit a3b9bc0d90
2 changed files with 3 additions and 3 deletions

View File

@ -89,7 +89,7 @@ class PayPalHint(models.Model):
user = models.ForeignKey(User, related_name='paypal_hints', blank=True, null=True, on_delete=models.SET_NULL) user = models.ForeignKey(User, related_name='paypal_hints', blank=True, null=True, on_delete=models.SET_NULL)
account = models.CharField(unique=True, max_length=13) account = models.CharField(unique=True, max_length=13)
member_id = models.IntegerField() member_id = models.IntegerField(null=True)
history = HistoricalRecords() history = HistoricalRecords()

View File

@ -330,14 +330,14 @@ def process_paypal_ipn(data):
try: try:
user = hints.get(account=data['payer_id']).user user = hints.get(account=data['payer_id']).user
except hints.DoesNotExist: except models.PayPalHint.DoesNotExist:
logger.info('IPN - No PayPalHint found for %s', data['payer_id']) logger.info('IPN - No PayPalHint found for %s', data['payer_id'])
if not user and 'member' in custom_json: if not user and 'member' in custom_json:
member_id = custom_json['member'] member_id = custom_json['member']
try: try:
user = members.get(id=member_id).user user = members.get(id=member_id).user
except members.DoesNotExist: except models.Member.DoesNotExist:
pass pass
if not user: if not user: