Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix upgrade step

  • Loading branch information...
commit bfca67099c864f622fdd40e19432221663b4802f 1 parent 57aef7f
@vangheem vangheem authored
View
3  collective/routes/profiles/default/metadata.xml
@@ -1,4 +1,7 @@
<?xml version="1.0"?>
<metadata>
<version>1100</version>
+ <dependencies>
+ <dependency>profile-plone.app.registry:default</dependency>
+ </dependencies>
</metadata>
View
13 collective/routes/upgrades.py
@@ -8,16 +8,17 @@
uninstall_profile = 'profile-collective.routes:uninstall'
-def upgrade_to_1_1a1(context):
+def upgrade_to_1_1(context):
+ # get activated routes before switching over
+ pprops = getToolByName(context, 'portal_properties')
+ props = pprops.routes_properties
+ activated_routes = props.getProperty('activated_routes', ())
+
context.runImportStepFromProfile(uninstall_profile, 'controlpanel')
- context.runImportStepFromProfile(default_profile, 'controlpanel')
context.runImportStepFromProfile(uninstall_profile, 'propertiestool')
- context.runImportStepFromProfile(default_profile, 'propertiestool')
+ context.runAllImportStepsFromProfile(default_profile)
# convert selected routes
- pprops = getToolByName(context, 'portal_properties')
- props = pprops.routes_properties
- activated_routes = props.getProperty('activated_routes', ())
registry = getUtility(IRegistry)
settings = registry.forInterface(IRoutesSettings)
settings.routes = set(activated_routes)
View
4 collective/routes/upgrades.zcml
@@ -4,11 +4,11 @@
i18n_domain="collective.routes">
<gs:upgradeStep
- title="Upgrade collective.routes to 1.0a1 from 1.1a1"
+ title="Upgrade collective.routes to 1.0* from 1.1*"
description="collective.routes upgrade step"
source="*"
destination="1100"
- handler=".upgrades.upgrade_to_1_1a1"
+ handler=".upgrades.upgrade_to_1_1"
profile="collective.routes:default" />
</configure>
Please sign in to comment.
Something went wrong with that request. Please try again.