Skip to content

Project Builder: add Field Guide Cleaner (admin-only)#7406

Open
shaunanoordin wants to merge 3 commits intomainfrom
fix-too-many-field-guide-images
Open

Project Builder: add Field Guide Cleaner (admin-only)#7406
shaunanoordin wants to merge 3 commits intomainfrom
fix-too-many-field-guide-images

Conversation

@shaunanoordin
Copy link
Copy Markdown
Member

@shaunanoordin shaunanoordin commented Jan 29, 2026

PR Overview

Supports #7405
Affects: Project Builder -> Edit Field Guide page (Admin mode only)
Staging branch URL: https://pr-7406.pfe-preview.zooniverse.org/lab/2023/guide?env=staging or https://pr-7406.pfe-preview.zooniverse.org/lab/24617/guide?env=production

This PR adds an admin-only tool, the Field Guide Cleaner, to the edit Field Guide page.

  • As noted in 7405, there's a bug in the Edit Field Guide page that lets "cleared" icons sometimes still stick around as part of a Field Guide's attached_images.
  • This tool lists all images (icons) attached to a Field Guide, and shows which of those images are actually used in the Field Guide, and which are orphans.
  • There's also a button that deletes (attached_image_resource.delete()) those orphaned icons.
  • To enable this tool, ** you must have admin mode enabled.**
image

⚠️ NOTE: this tool assumes that attached_images uploaded for a Field Guide aren't used anywhere else. This is a pretty safe assumption given the use case, and given that the uploaded icons are supposed to be deleted when their associated FG pages are deleted, but theoretically it's possible to do some really weird linkages with the Panoptes API if you're a mad scientist or something.

Status

Ready for review.

I'm going ahead and running this for Marine Lens: Florida Keys to help solve their immediate issue.

@coveralls
Copy link
Copy Markdown

coveralls commented Jan 29, 2026

Coverage Status

coverage: 55.977% (-0.01%) from 55.991%
when pulling fc52cf3 on fix-too-many-field-guide-images
into cfa8aab on main.

@shaunanoordin shaunanoordin force-pushed the fix-too-many-field-guide-images branch from e21bb73 to fc52cf3 Compare February 13, 2026 16:27
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.

2 participants