Fix PDF download error for documents without PDF files#358
Merged
C4ptainCrunch merged 1 commit intomainfrom Dec 25, 2025
Merged
Fix PDF download error for documents without PDF files#358C4ptainCrunch merged 1 commit intomainfrom
C4ptainCrunch merged 1 commit intomainfrom
Conversation
ca7c06a to
6634dc9
Compare
C4ptainCrunch
commented
Dec 25, 2025
Fixes DOCHUB-1V7 This issue was causing 32k+ errors with 411 users affected. Changes: 1. Add check in document_pdf_file view to return 404 if document has no PDF file 2. Add check in document_original_file view to return 404 if document has no original file 3. Update "Télécharger" button to download PDF if available, otherwise download original file The download button now always appears but intelligently chooses the appropriate file to download. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
6634dc9 to
dcd8a1f
Compare
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.
Summary
Fixes DOCHUB-1V7 - Fix ValueError when accessing documents without PDF files
This issue was causing 32,121 errors affecting 411 users when they tried to download documents that don't have a PDF file associated with them.
Changes
document_pdf_fileview to return 404 if document has no PDF filedocument_original_fileview to return 404 if document has no original fileBehavior
Test plan
Impact
This will fix the Sentry issue and provide a better user experience by always offering a download option, even for documents that haven't been converted to PDF yet.
🤖 Generated with Claude Code