Skip to content

fix: handle form validation errors more robustly in document number extraction#199

Draft
seer-by-sentry[bot] wants to merge 2 commits intomainfrom
autofix/fix-document-number-form-validation
Draft

fix: handle form validation errors more robustly in document number extraction#199
seer-by-sentry[bot] wants to merge 2 commits intomainfrom
autofix/fix-document-number-form-validation

Conversation

@seer-by-sentry
Copy link
Copy Markdown

👋 Hi there! This PR was automatically generated by Autofix 🤖

This fix was triggered by Michael Lissner

Fixes DOCTOR-27

This commit improves the error handling in the document number extraction view.

  • Switches from request.GET to request.POST for form data.
  • Improves error message extraction from the form, handling cases where the error is in __all__, file, or other fields.
  • Adds a test case to verify that form validation errors are handled correctly.

If you have any questions or feedback for the Sentry team about this fix, please email [email protected] with the Run ID: 10129.

@sentry
Copy link
Copy Markdown

sentry bot commented Mar 13, 2025

🔍 Existing Issues For Review

Your pull request is modifying functions with the following pre-existing issues:

📄 File: doctor/views.py

Function Unhandled Issue
get_document_number KeyError: 'all' /utils/document-number/pdf/
Event Count: 1

Did you find this useful? React with a 👍 or 👎

@mlissner mlissner requested a review from flooie March 13, 2025 04:31
@mlissner
Copy link
Copy Markdown
Member

@flooie, can you take a look at this one, please? Sentry generated a fix for a bug it detected, and then created this pull request (!). It might be garbage, but the error was real, and we should fix it. Looks fairly straightforward, I think!

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