Skip to content

Commit aa12c22

Browse files
jonfroehlichclaude
andcommitted
style(admin): rename artifact thumbnail field label to "PDF thumbnail" (#1380)
Per review feedback, "Thumbnail preview" → "PDF thumbnail" on the change form (clearer that it's the PDF-derived thumbnail). Also updates the <img> alt text and the regression test to match. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent da2094c commit aa12c22

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

website/admin/artifact_admin.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,13 @@ def thumbnail_preview(self, obj):
8989
)
9090
return placeholder
9191
return format_html(
92-
'<img src="{}" alt="Thumbnail preview" '
92+
'<img src="{}" alt="PDF thumbnail" '
9393
'style="height:{}px; width:auto; border:1px solid #ddd;" />',
9494
thumbnail_url, self.THUMBNAIL_PREVIEW_HEIGHT,
9595
)
9696

97-
thumbnail_preview.short_description = 'Thumbnail preview'
97+
# Django auto-appends the trailing colon in the admin label.
98+
thumbnail_preview.short_description = 'PDF thumbnail'
9899

99100
def get_fieldsets(self, request, obj=None):
100101
"""

website/tests/test_admin_thumbnail_preview.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def test_change_form_get_renders_img_end_to_end(self):
112112

113113
self.assertEqual(resp.status_code, 200)
114114
body = resp.content.decode()
115-
self.assertIn('alt="Thumbnail preview"', body)
115+
self.assertIn('alt="PDF thumbnail"', body)
116116
self.assertIn("<img", body)
117117
# The tag is real markup, not escaped into visible text.
118118
self.assertNotIn("&lt;img", body)

0 commit comments

Comments
 (0)