Repository navigation
Conversation
TutorCruncher reports a Stars custom field as type "decimal", which the enquiry form's type lookups didn't have, so a Stars field on the enquiry form raised KeyError on GET and POST. Show it as a whole-number input and check the value against the field's min, max and decimal places before queueing, then send it to TutorCruncher as a float. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
The enquiry form sends "" for a box typed in then cleared. For an optional field this now counts as not filled in, instead of failing the whole enquiry with "value is not a valid decimal". Text and a dropdown with an empty option still send "". The same validator is in the Link PR (#563), byte for byte, so the two merge cleanly in either order. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
tejas7777
added a commit
that referenced
this pull request
Oct 16, 2026
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Contributor
Author
|
Moved into #563. |
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.
What changed
decimal) is sent to the widget as field typeinteger, a whole-number input. TutorCruncher's own forms take whole stars too.pydantic.condecimal, using the field'smin_value,max_value,max_digitsanddecimal_placesfrom the OPTIONS response. A value out of range or with too many decimal places returns 400invalid attribute data, so it is never queued for TutorCruncher to refuse later.submit_enquiryposts with plainjson.dumps, which can't encode aDecimal.""for an optional field (a box typed in, then cleared) counts as not filled in. Text, and a dropdown with an empty option, still send"".Why
FIELD_TYPE_LOOKUPandFIELD_VALIDATION_LOOKUPhave nodecimal. A Client Stars field with "Enquiry Form" ticked raisesKeyError: 'decimal'on GET (_convert_field) and POST, so that branch's whole enquiry form fails. TutorCruncher's setup page allows such a field. Today no branch has one.A Stars box typed in, then cleared, sent
""and failed the whole enquiry with "value is not a valid decimal".How it was tested
test_enquiries.py:integerand keepsmin_value/max_value.'4'is submitted to TutorCruncher as4.0.6and POST'4.555'each return 400 with the pydantic error, and nothing is sent to TutorCruncher.""is submitted with no Stars value.starsvariant of the fake enquiry options copies TutorCruncher's real OPTIONS entry for a Stars field.test_enquiries.py: 24 passed.flake8andmake formatare clean.Independent of TutorCruncher2 and of #563. Deploy any time.
🤖 Generated with Claude Code