Handle inapp_pay not being installed (like on straight AMO)

In other words: the foreign key backwards relationship is only applied when an
app appears in INSTALLED_APPS
This commit is contained in:
Kumar McMillan 2012-04-18 11:34:22 -05:00
Родитель a9a413195b
Коммит 37ceb59759
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -188,7 +188,7 @@ class Contribution(amo.models.ModelBase):
When a reversal (or chargeback) is received from a PayPal IPN
for this contribution, the hook is called.
"""
if self.inapp_payment.count():
if hasattr(self, 'inapp_payment') and self.inapp_payment.count():
self.inapp_payment.get().handle_reversal()
def _switch_locale(self):