Photo admin: guard resolution column + add project column (#1346)#1360
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes the last open item on the admin changelist audit (#1346, Phase 4).
What
Photo.get_resolution_as_stragainst missing/unreadable image files. Readingpicture.width/heightopens 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 returnsUnknowninstead of raising.projectas a changelist column, withlist_select_related('project')so the column stays constant-query as rows grow.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