-
Notifications
You must be signed in to change notification settings - Fork 0
URBBDC-3225: feature configurable houssing subject #565
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 2.9.x
Are you sure you want to change the base?
Changes from all commits
2906ed6
d54c347
61ec8fb
242b2c5
691ab0b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| Introduce configurable title formatting for housing, division and urbanc ertificate | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix typo mentioned by coderabbit |
||
| [WBoudabous] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -240,6 +240,15 @@ | |
| multiValued=True, | ||
| vocabulary_factory="urban.licence_state", | ||
| ), | ||
| StringField( | ||
| name="customTitle", | ||
| widget=StringField._properties["widget"]( | ||
| size=100, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add a description to specify that this field will be only useful for Housing, Division, CODT_UrbanCertificateBase |
||
| label=_("urban_label_customTitle", default="Custom title"), | ||
| ), | ||
| schemata="public_settings", | ||
| ), | ||
|
|
||
| ), | ||
| ) | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1564,6 +1564,15 @@ def getLicenceConfig(self): | |
|
|
||
| return config_folder | ||
|
|
||
| def _apply_custom_title(self): | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This method will introduce duplicate titles because all licences will have exactly the same one. |
||
| licence_config = self.getLicenceConfig() | ||
| custom_title = licence_config.getCustomTitle() | ||
| if custom_title: | ||
| self.setTitle(custom_title) | ||
| self.reindexObject(idxs=("Title", "sortable_title")) | ||
| return True | ||
|
mpeeters marked this conversation as resolved.
|
||
| return False | ||
|
|
||
| security.declarePublic("attributeIsUsed") | ||
|
|
||
| def attributeIsUsed(self, name): | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -365,6 +365,12 @@ def update_folder_manager_notice(context): | |
| logger.info("manageableLicences updated for notice FolderManager") | ||
|
|
||
|
|
||
| def update_custom_titles(context): | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This method will no do anything because the licences configs are not updated before. |
||
| catalog = api.portal.get_tool("portal_catalog") | ||
| brains = catalog(portal_type=["Housing", "Division","CODT_UrbanCertificateBase"]) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use plone.api.content.find instead |
||
| for brain in brains: | ||
| obj = brain.getObject() | ||
| obj.updateTitle() | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing blank lines and your code should be the latest migration. |
||
| def setup_index_referenceDGATLP(context): | ||
| logger = logging.getLogger("urban: Set up `referenceDGATLP` index") | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -108,4 +108,12 @@ | |||||
| handler=".update_290.setup_index_referenceDGATLP" | ||||||
| profile="Products.urban:default" /> | ||||||
|
|
||||||
| <gs:upgradeStep | ||||||
| title="Update titles for Housing, Division and Urbanncertificate" | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix typo in upgrade-step title.
Proposed fix- title="Update titles for Housing, Division and Urbanncertificate"
+ title="Update titles for Housing, Division and UrbanCertificate"📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix typo |
||||||
| description="" | ||||||
| source="2913" | ||||||
| destination="2914" | ||||||
| handler=".update_290.update_custom_titles" | ||||||
| profile="Products.urban:default" /> | ||||||
|
|
||||||
| </configure> | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix typo in the feature note.
urbanc ertificateshould beurban certificate.Proposed fix
📝 Committable suggestion
🤖 Prompt for AI Agents