Skip to content

SUP-51505 remove filter for all licences except RoadDecree permits and Tickets - #551

Open
WBoudabous wants to merge 1 commit into
2.9.xfrom
SUP-51505_allow-all-urban-types-bound-licence
Open

SUP-51505 remove filter for all licences except RoadDecree permits and Tickets#551
WBoudabous wants to merge 1 commit into
2.9.xfrom
SUP-51505_allow-all-urban-types-bound-licence

Conversation

@WBoudabous

@WBoudabous WBoudabous commented Apr 20, 2026

Copy link
Copy Markdown
Contributor

This PR updates the bound_licences field to allow all licence types,
while keeping restrictions for:

  • Roadcree
  • Tickets

Summary by CodeRabbit

  • Bug Fixes
    • Expanded licence type compatibility by removing restrictions on linked licence types, allowing a broader range of licence combinations to be referenced within the system.

@coderabbitai

coderabbitai Bot commented Apr 20, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

This PR modifies the bound_licences field configuration across three licence content types to permit all URBAN_TYPES instead of excluding specific types such as Inspection, Ticket, and various certificates. A news entry documents the change.

Changes

Cohort / File(s) Summary
News Entry
news/SUP-51505.feature
Added feature news entry documenting the removal of bound_licences filter restrictions for most licence types, except RoadDecree and Tickets.
Licence Type Field Configuration
src/Products/urban/content/licence/CODT_BaseBuildLicence.py, src/Products/urban/content/licence/Inspection.py, src/Products/urban/content/licence/PatrimonyCertificate.py
Simplified bound_licences field's allowed_types from filtered exclusion lists to unfiltered URBAN_TYPES, permitting all licence types to be referenced instead of blocking Inspection, Ticket, ProjectMeeting, and certificate-related types.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 Filters fall away like morning dew,
All licence types now break on through,
No more gates upon the bound,
Where references were lost, they're found!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: removal of the bound_licences filter for most licence types except RoadDecree and Tickets.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch SUP-51505_allow-all-urban-types-bound-licence

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 7281f3f and a762ad4.

📒 Files selected for processing (4)
  • news/SUP-51505.feature
  • src/Products/urban/content/licence/CODT_BaseBuildLicence.py
  • src/Products/urban/content/licence/Inspection.py
  • src/Products/urban/content/licence/PatrimonyCertificate.py

"UrbanCertificateOne",
]
],
allowed_types=[t for t in URBAN_TYPES],

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

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

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