I'd rather see two filters than the sorted/group_by/dict/tuple. It looks like `users_addons` is what you want to iterate over, too.

```python
for user, addons in users_addons.items():
    user.passing_addons = [a for a in addons if a.errors == 0]
    user.failing_addons = [a for a in addons if a.errors > 0]
```