Skip to content

Commit

Permalink
URB-2828: Remove covid from optional field
Browse files Browse the repository at this point in the history
  • Loading branch information
jimbiscuit committed Dec 4, 2024
1 parent 2b98666 commit abb39a9
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 1 deletion.
2 changes: 2 additions & 0 deletions news/URB-2828.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Remove covid from optional field
[jchandelle]
13 changes: 13 additions & 0 deletions src/Products/urban/migration/update_270.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,3 +329,16 @@ def fix_patrimony_certificate_class(context):
licence.reindexObject()

logger.info("upgrade step done!")


def remove_covid_from_optional_field(context):
logger = logging.getLogger('urban: Remove covid from optional field')
logger.info("starting upgrade steps")
portal_urban = api.portal.get_tool('portal_urban')
for licence_config in portal_urban.get_all_licence_configs():
used_attributes = licence_config.getUsedAttributes()
if 'covid' not in used_attributes:
continue
licence_config.setUsedAttributes(
tuple(attr for attr in used_attributes if attr != 'covid')
)
8 changes: 8 additions & 0 deletions src/Products/urban/migration/upgrades.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -729,4 +729,12 @@
profile="Products.urban:default"
/>

<gs:upgradeStep
title="Remove covid from optional field"
description="Remove covid from optional field"
source="1159"
destination="1160"
handler=".update_270.remove_covid_from_optional_field"
profile="Products.urban:default" />

</configure>
2 changes: 1 addition & 1 deletion src/Products/urban/profiles/default/metadata.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<metadata>
<version>1159</version>
<version>1160</version>
<dependencies>
<dependency>profile-Products.urban:preinstall</dependency>
</dependencies>
Expand Down

0 comments on commit abb39a9

Please sign in to comment.