fix(client/requests): hide draft quotes from the client-facing detail page#45
Open
AntoinePoindron wants to merge 1 commit intomainfrom
Open
fix(client/requests): hide draft quotes from the client-facing detail page#45AntoinePoindron wants to merge 1 commit intomainfrom
AntoinePoindron wants to merge 1 commit intomainfrom
Conversation
… page Drafts are caterer-only — they're work-in-progress quotes the caterer hasn't sent yet. Surfacing them on the client side leaks pricing + caterer identity before the caterer is ready to commit (and the client sees a "Brouillon" badge they shouldn't even know exists). Filter at the DB level — `select(Quote).where(Quote.status != QuoteStatus.draft)` — so the row never reaches a Jinja context. Templates aren't touched. The companion route `client.quote_pdf` (PR #44) gets the same filter in its own branch. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
A draft quote (the caterer's work-in-progress before they hit Envoyer) was leaking onto the client's
/client/requests/<id>page — visible as a card with a "Brouillon" badge, complete with pricing and the caterer's identity. Filter it at the DB level so the row never reaches the template.Reported by @AntoinePoindron with a screenshot showing a draft quote among the received list. Fix validated end-to-end manually before opening this PR.
What changed
blueprints/client/requests.py::request_detailaddsQuote.status != QuoteStatus.draftto theSELECT. The companion display helpers (_derive_request_display_status,_request_quote_counts) already exclude drafts via_QUOTE_RECEIVED_STATUSES, so the count badges and tab buckets stay correct without further changes.What is NOT changed
client.quote_pdfroute in feat(quote-preview): add "Télécharger" button to every quote-preview modal #44 — it gets the same gate in its own branch (companion fix).Test plan
/client/requests/<id>disappears once the route is filtered, and the Devis reçu(s) count + tab bucketing still match the visible quotes.🤖 Generated with Claude Code