File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change 5
5
6
6
def get_callback_function (settings_name , default = None ):
7
7
"""Return the callback function for the given settings name."""
8
-
9
8
callback = getattr (settings , settings_name , None )
10
9
if not callback :
11
10
return default
@@ -22,12 +21,11 @@ def get_callback_function(settings_name, default=None):
22
21
23
22
24
23
def get_task_props_extension (request , task_props ):
25
- """Extend the task properties with custom properties to fill custom models."""
26
-
27
- task_props_extension = extend_task_props_callback (request , task_props ) or {}
28
- if task_props_extension is None :
24
+ """Extend the task properties with custom props to fill custom models."""
25
+ if not extend_task_props_callback :
29
26
return {}
30
27
28
+ task_props_extension = extend_task_props_callback (request , task_props ) or {}
31
29
if not isinstance (task_props_extension , Mapping ):
32
30
raise ImproperlyConfigured (
33
31
"CELERY_RESULTS_EXTEND_TASK_PROPS_CALLBACK must return a Mapping "
You can’t perform that action at this time.
0 commit comments