Missed a return on exception

This commit is contained in:
Ilan Steemers
2015-07-05 21:09:05 +02:00
parent 6c5a96c135
commit e7d2dd0309

View File

@@ -48,11 +48,11 @@ def call_hook(sender, instance, **kwargs):
f = getattr(m, func)
except (ValueError, ImportError, AttributeError):
logger.error(_('malformed return hook \'{}\' for {}').format(instance.hook, instance.name))
return
try:
f(instance)
except Exception as e:
logger.error(_('return hook {} failed on {}').format(instance.hook, instance.name))
logger.exception(e)
logger.error(_('return hook {} failed on {} because {}').format(instance.hook, instance.name, e))
class SuccessManager(models.Manager):