Skip to content

Commit

Permalink
send signals based on success rather than flags
Browse files Browse the repository at this point in the history
  • Loading branch information
mthornhill committed Apr 20, 2009
1 parent 7a26dcc commit ef38f2c
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions standard/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,8 @@ def verify(self, item_check_callable=None, test=True):
if not settings.PAYPAL_IDENTITY_TOKEN:
raise Exception("You must set settings.PAYPAL_IDENTITY_TOKEN in settings.py, you can get this token by enabling PDT in your paypal business account")

if self._postback(test):
success = self._postback(test)
if success:
if self.is_transaction():
if self.payment_status != "Completed":
self.set_flag("Invalid payment_status.")
Expand All @@ -426,10 +427,11 @@ def verify(self, item_check_callable=None, test=True):
self.set_flag("FAIL")

self.save()
if self.flag:
pdt_failed.send(sender=self)
else:
pdt_successful.send(sender=self)
if success:
pdt_successful.send(sender=self)
else:
pdt_failed.send(sender=self)


def __unicode__(self):
fmt = u"<PDT: %s %s>"
Expand Down

0 comments on commit ef38f2c

Please sign in to comment.