You can simplify this:
```python
job_tasks = tasks_in_jobs.setdefault(task.job_id, [])
job_tasks.append(task)
```