diff --git a/django_celery_results/backends/database.py b/django_celery_results/backends/database.py index d9348b49..1d5db1e7 100644 --- a/django_celery_results/backends/database.py +++ b/django_celery_results/backends/database.py @@ -79,10 +79,6 @@ def _get_extended_properties(self, request, traceback): # task protocol 1 task_kwargs = getattr(request, 'kwargs', None) - # TODO: We assuming that task protocol 1 could be always in use. :/ - extended_props.update( - extend_task_props_callback(getattr(request, 'kwargs', None))) - # Encode input arguments if task_args is not None: _, _, task_args = self.encode_content(task_args) @@ -133,6 +129,9 @@ def _store_result( self._get_extended_properties(request, traceback) ) + task_props.update( + extend_task_props_callback(request, dict(task_props))) + self.TaskModel._default_manager.store_result(**task_props) return result