Skip to content

Commit

Permalink
Fix detection of customized task as class attribute with Django
Browse files Browse the repository at this point in the history
  • Loading branch information
browniebroke authored and Nusnus committed May 23, 2024
1 parent a993f7b commit 0d8936d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion celery/app/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,12 @@ def __init__(self, main=None, loader=None, backend=None,
self.loader_cls = loader or self._get_default_loader()
self.log_cls = log or self.log_cls
self.control_cls = control or self.control_cls
self._custom_task_cls_used = bool(task_cls)
self._custom_task_cls_used = (
# Custom task class provided as argument
bool(task_cls)
# subclass of Celery with a task_cls attribute
or self.__class__ is not Celery and hasattr(self.__class__, 'task_cls')
)
self.task_cls = task_cls or self.task_cls
self.set_as_current = set_as_current
self.registry_cls = symbol_by_name(self.registry_cls)
Expand Down

0 comments on commit 0d8936d

Please sign in to comment.