diff options
| author | Elias Hernandis <elias@hernandis.me> | 2026-02-18 08:10:40 +0100 |
|---|---|---|
| committer | Jacob Walls <jacobtylerwalls@gmail.com> | 2026-02-25 13:52:23 -0500 |
| commit | 497d9cdc67f0bdae929fcde677b5f441e94a6c8b (patch) | |
| tree | e98b4940fa1732d8d7932c3a691e62a9c8606ed3 /django/tasks | |
| parent | bbc6818bc12f14c1764a7eb68556018195f56b59 (diff) | |
Fixed #36951 -- Removed empty exc_info from log_task_finished signal handler.
Before, if no exception occurred, "None Type: None" was logged.
Diffstat (limited to 'django/tasks')
| -rw-r--r-- | django/tasks/signals.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/django/tasks/signals.py b/django/tasks/signals.py index 288fe08e32..919dae0222 100644 --- a/django/tasks/signals.py +++ b/django/tasks/signals.py @@ -49,6 +49,8 @@ def log_task_started(sender, task_result, **kwargs): @receiver(task_finished) def log_task_finished(sender, task_result, **kwargs): + # Signal is sent inside exception handlers, so exc_info() is available. + exc_info = sys.exc_info() logger.log( ( logging.ERROR @@ -59,6 +61,5 @@ def log_task_finished(sender, task_result, **kwargs): task_result.id, task_result.task.module_path, task_result.status, - # Signal is sent inside exception handlers, so exc_info() is available. - exc_info=sys.exc_info(), + exc_info=exc_info if exc_info[0] else None, ) |
