Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

seer-by-sentry[bot]
Copy link

👋 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.

Copy link

sentry-io 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
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