Skip to content

Photo admin: guard resolution column + add project column (#1346)#1360

Merged
jonfroehlich merged 1 commit into
masterfrom
1346-photo-admin-guard
Jun 21, 2026
Merged

Photo admin: guard resolution column + add project column (#1346)#1360
jonfroehlich merged 1 commit into
masterfrom
1346-photo-admin-guard

Conversation

@jonfroehlich

Copy link
Copy Markdown
Member

Closes the last open item on the admin changelist audit (#1346, Phase 4).

What

  • Guard Photo.get_resolution_as_str against missing/unreadable image files. Reading picture.width/height opens the file, so one bad file would 500 the entire Photo changelist (the same crash class as the News thumbnail bug that headlined Admin changelist audit: make all listing pages manageable (perf + findability) #1346). Now returns Unknown instead of raising.
  • Add the owning project as a changelist column, with list_select_related('project') so the column stays constant-query as rows grow.
  • Regression tests for both.

Scope

Admin-only; no model or migration changes (admin changelists are not Pa11y-scanned). With this merged, every checkbox on #1346 is satisfied — the issue can be closed.

Test

python manage.py test website.tests.test_admin_changelist --settings=makeabilitylab.settings_test — 16 tests green.

🤖 Generated with Claude Code

Closes the last Phase 4 item on the admin changelist audit:

- Guard Photo.get_resolution_as_str against missing/unreadable image files.
  Reading picture.width/height opens the file, so one bad file would 500 the
  whole Photo changelist (same crash class as the News thumbnail guard).
  Returns 'Unknown' instead of raising.
- Add the owning `project` as a changelist column, with list_select_related
  so the column stays constant-query as rows grow.
- Regression tests for both.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jonfroehlich jonfroehlich merged commit 2d25bde into master Jun 21, 2026
3 checks passed
@jonfroehlich jonfroehlich deleted the 1346-photo-admin-guard branch June 22, 2026 20:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant