mirror of
https://github.com/django-q2/django-q2.git
synced 2026-10-06 20:38:12 +08:00
consistent task name formatting
This commit is contained in:
+2
-2
@@ -57,12 +57,12 @@ def call_hook(sender, instance, **kwargs):
|
|||||||
m = importlib.import_module(module)
|
m = importlib.import_module(module)
|
||||||
f = getattr(m, func)
|
f = getattr(m, func)
|
||||||
except (ValueError, ImportError, AttributeError):
|
except (ValueError, ImportError, AttributeError):
|
||||||
logger.error(_('malformed return hook \'{}\' for {}').format(instance.hook, instance.name))
|
logger.error(_('malformed return hook \'{}\' for [{}]').format(instance.hook, instance.name))
|
||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
f(instance)
|
f(instance)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(_('return hook {} failed on {} because {}').format(instance.hook, instance.name, e))
|
logger.error(_('return hook {} failed on [{}] because {}').format(instance.hook, instance.name, e))
|
||||||
|
|
||||||
|
|
||||||
class SuccessManager(models.Manager):
|
class SuccessManager(models.Manager):
|
||||||
|
|||||||
Reference in New Issue
Block a user