Fix bugs
This commit is contained in:
parent
6b76057cab
commit
a3b9bc0d90
|
@ -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()
|
||||||
|
|
||||||
|
|
|
@ -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:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user