URBBDC-3225: feature configurable houssing subject#565
Conversation
📝 WalkthroughWalkthroughThe pull request introduces configurable custom title formatting for three license object types (Housing, Division, CODT_UrbanCertificateBase). A new ChangesCustom Title Configuration and Application
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ 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: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@news/URBBDC-3225.feature`:
- Line 1: Update the feature note text that currently contains the typo "urbanc
ertificate" to read "urban certificate"; locate the title/description line in
the URBBDC-3225.feature content where "Introduce configurable title formatting
for housing, division and urbanc ertificate" appears and correct that phrase to
"Introduce configurable title formatting for housing, division and urban
certificate".
In `@src/Products/urban/content/licence/GenericLicence.py`:
- Around line 1569-1573: When applying a custom title in GenericLicence.py (the
block using licence_config.getCustomTitle(), self.setTitle(custom_title), and
self.reindexObject(...)), ensure the catalog reindex mirrors the legacy path by
including the applicantInfosIndex; update the reindexObject call to reindex
"Title", "sortable_title" and "applicantInfosIndex" so applicant-related catalog
data stays in sync when updateTitle() takes the custom-title branch.
In `@src/Products/urban/migration/upgrades_290.zcml`:
- Line 112: Fix the typo in the upgrade step title attribute: change the title
value that currently reads "Update titles for Housing, Division and
Urbanncertificate" to "Update titles for Housing, Division and UrbanCertificate"
by updating the title="..." attribute on the upgrade-step (or related element)
so the "Urbanncertificate" token is corrected to "UrbanCertificate".
🪄 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: 617655c0-9a03-4554-9aef-0828c9ae7fae
📒 Files selected for processing (10)
news/URBBDC-3225.featuresrc/Products/urban/LicenceConfig.pysrc/Products/urban/content/licence/CODT_UrbanCertificateBase.pysrc/Products/urban/content/licence/Division.pysrc/Products/urban/content/licence/GenericLicence.pysrc/Products/urban/content/licence/Housing.pysrc/Products/urban/locales/fr/LC_MESSAGES/urban.posrc/Products/urban/migration/update_290.pysrc/Products/urban/migration/upgrades_290.zcmlsrc/Products/urban/profiles/default/metadata.xml
| @@ -0,0 +1,2 @@ | |||
| Introduce configurable title formatting for housing, division and urbanc ertificate | |||
There was a problem hiding this comment.
Fix typo in the feature note.
urbanc ertificate should be urban certificate.
Proposed fix
-Introduce configurable title formatting for housing, division and urbanc ertificate
+Introduce configurable title formatting for housing, division and urban certificate📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| Introduce configurable title formatting for housing, division and urbanc ertificate | |
| Introduce configurable title formatting for housing, division and urban certificate |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@news/URBBDC-3225.feature` at line 1, Update the feature note text that
currently contains the typo "urbanc ertificate" to read "urban certificate";
locate the title/description line in the URBBDC-3225.feature content where
"Introduce configurable title formatting for housing, division and urbanc
ertificate" appears and correct that phrase to "Introduce configurable title
formatting for housing, division and urban certificate".
| profile="Products.urban:default" /> | ||
|
|
||
| <gs:upgradeStep | ||
| title="Update titles for Housing, Division and Urbanncertificate" |
There was a problem hiding this comment.
Fix typo in upgrade-step title.
Urbanncertificate should be UrbanCertificate.
Proposed fix
- title="Update titles for Housing, Division and Urbanncertificate"
+ title="Update titles for Housing, Division and UrbanCertificate"📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| title="Update titles for Housing, Division and Urbanncertificate" | |
| title="Update titles for Housing, Division and UrbanCertificate" |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/Products/urban/migration/upgrades_290.zcml` at line 112, Fix the typo in
the upgrade step title attribute: change the title value that currently reads
"Update titles for Housing, Division and Urbanncertificate" to "Update titles
for Housing, Division and UrbanCertificate" by updating the title="..."
attribute on the upgrade-step (or related element) so the "Urbanncertificate"
token is corrected to "UrbanCertificate".
| @@ -0,0 +1,2 @@ | |||
| Introduce configurable title formatting for housing, division and urbanc ertificate | |||
There was a problem hiding this comment.
Fix typo mentioned by coderabbit
|
|
||
| def update_custom_titles(context): | ||
| catalog = api.portal.get_tool("portal_catalog") | ||
| brains = catalog(portal_type=["Housing", "Division","CODT_UrbanCertificateBase"]) |
There was a problem hiding this comment.
Use plone.api.content.find instead
| brains = catalog(portal_type=["Housing", "Division","CODT_UrbanCertificateBase"]) | ||
| for brain in brains: | ||
| obj = brain.getObject() | ||
| obj.updateTitle() |
There was a problem hiding this comment.
Missing blank lines and your code should be the latest migration.
| profile="Products.urban:default" /> | ||
|
|
||
| <gs:upgradeStep | ||
| title="Update titles for Housing, Division and Urbanncertificate" |
There was a problem hiding this comment.
Fix typo Urbanncertificate -> UrbanCertificate
| StringField( | ||
| name="customTitle", | ||
| widget=StringField._properties["widget"]( | ||
| size=100, |
There was a problem hiding this comment.
Add a description to specify that this field will be only useful for Housing, Division, CODT_UrbanCertificateBase
|
|
||
| return config_folder | ||
|
|
||
| def _apply_custom_title(self): |
There was a problem hiding this comment.
This method will introduce duplicate titles because all licences will have exactly the same one.
| logger.info("manageableLicences updated for notice FolderManager") | ||
|
|
||
|
|
||
| def update_custom_titles(context): |
There was a problem hiding this comment.
This method will no do anything because the licences configs are not updated before.
|
Please fix the conflict as well |
This pull request adds the possibility to configure the dossier subject automatically via configurable title formatting for housing, division and urban certificate dossiers.
Summary by CodeRabbit
New Features
Improvements