Commit d2072f8
authored
fix: return 404 for deleted activity in activity_retrieve endpoint (#2037)
Previously, fetching a deleted activity without a version would cause a `NullPointerError` or undefined behavior downstream (attempting `schema.applet_id` on `None`). Now it returns a proper 404.
Changes:
- Add null check after ActivitiesCRUD.get_by_id() to raise ActivityDoeNotExist
- Update test assertion to expect HTTP 404 instead of generic != 200
Notes:
- `ActivityDoeNotExist` already existed in `apps/activities/errors.py`
- Only affects the unversioned code path in `activity_retrieve` (the versioned path was already safe)1 parent c52eaf6 commit d2072f8
2 files changed
Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
126 | 127 | | |
127 | 128 | | |
128 | 129 | | |
| 130 | + | |
| 131 | + | |
129 | 132 | | |
130 | 133 | | |
131 | 134 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
235 | | - | |
| 235 | + | |
236 | 236 | | |
237 | 237 | | |
238 | 238 | | |
239 | | - | |
| 239 | + | |
240 | 240 | | |
241 | 241 | | |
242 | 242 | | |
| |||
0 commit comments