SUP-51505 remove filter for all licences except RoadDecree permits and Tickets - #551
SUP-51505 remove filter for all licences except RoadDecree permits and Tickets#551WBoudabous wants to merge 1 commit into
Conversation
📝 WalkthroughWalkthroughThis PR modifies the Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/Products/urban/content/licence/Inspection.py`:
- Line 165: The bound_licences field was changed to allow all URBAN_TYPES, which
inadvertently re-includes RoadDecree and Ticket; restore the exclusion by
updating the bound_licences configuration to filter URBAN_TYPES minus the
exception set (e.g., define a shared constant EXCLUDED_BOUND_LICENCE_TYPES =
{"RoadDecree", "Ticket"} and use allowed_types=[t for t in URBAN_TYPES if t not
in EXCLUDED_BOUND_LICENCE_TYPES]) so bound_licences continues to exclude those
portal_type ids (refer to bound_licences and URBAN_TYPES in the file).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: d54c3084-db94-4218-93b3-84b92c8e816d
📒 Files selected for processing (4)
news/SUP-51505.featuresrc/Products/urban/content/licence/CODT_BaseBuildLicence.pysrc/Products/urban/content/licence/Inspection.pysrc/Products/urban/content/licence/PatrimonyCertificate.py
| "UrbanCertificateOne", | ||
| ] | ||
| ], | ||
| allowed_types=[t for t in URBAN_TYPES], |
There was a problem hiding this comment.
bound_licences now includes exception types that should remain filtered.
On Line 165, switching to all URBAN_TYPES appears to re-allow RoadDecree/Ticket(s), which conflicts with the PR objective (“except RoadDecree and Tickets”). Please keep those exception types excluded.
Suggested fix pattern
- allowed_types=[t for t in URBAN_TYPES],
+ allowed_types=[
+ t for t in URBAN_TYPES if t not in EXCLUDED_BOUND_LICENCE_TYPES
+ ],# define once (shared constant/module), with your exact portal_type ids
EXCLUDED_BOUND_LICENCE_TYPES = {"RoadDecree", "Ticket"}🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/Products/urban/content/licence/Inspection.py` at line 165, The
bound_licences field was changed to allow all URBAN_TYPES, which inadvertently
re-includes RoadDecree and Ticket; restore the exclusion by updating the
bound_licences configuration to filter URBAN_TYPES minus the exception set
(e.g., define a shared constant EXCLUDED_BOUND_LICENCE_TYPES = {"RoadDecree",
"Ticket"} and use allowed_types=[t for t in URBAN_TYPES if t not in
EXCLUDED_BOUND_LICENCE_TYPES]) so bound_licences continues to exclude those
portal_type ids (refer to bound_licences and URBAN_TYPES in the file).
This PR updates the bound_licences field to allow all licence types,
while keeping restrictions for:
Summary by CodeRabbit