Commit 553f0b5d authored by Hanno Schlichting's avatar Hanno Schlichting

Change VHM id to `virtual_hosting` to match AppInitializer.

parent 39033d38
......@@ -30,6 +30,8 @@ Features Added
Restructuring
+++++++++++++
- Change VHM id to `virtual_hosting` to match AppInitializer.
- Raise BadRequest instead of returning MessageDialog.
- Remove property management ZMI screens.
......
......@@ -31,8 +31,10 @@ from OFS import bbb
from OFS.metaconfigure import get_packages_to_initialize
from OFS.metaconfigure import package_initialized
from OFS.userfolder import UserFolder
from zExceptions import Redirect as RedirectException, Forbidden
from zExceptions import (
Forbidden,
Redirect as RedirectException,
)
from zope.interface import implements
import Folder
......@@ -270,10 +272,13 @@ class AppInitializer:
if 'virtual_hosting' not in app:
from Products.SiteAccess.VirtualHostMonster \
import VirtualHostMonster
vhm = VirtualHostMonster()
vhm.id = 'virtual_hosting'
vhm.addToContainer(app)
self.commit('Added virtual_hosting')
any_vhm = [obj for obj in app.values()
if isinstance(obj, VirtualHostMonster)]
if not any_vhm:
vhm = VirtualHostMonster()
vhm.id = 'virtual_hosting'
vhm.addToContainer(app)
self.commit('Added virtual_hosting')
def install_products(self):
return install_products()
......
......@@ -24,7 +24,7 @@ class VirtualHostMonster(Persistent, Item, Implicit):
meta_type = 'Virtual Host Monster'
priority = 25
id = 'VHM'
id = 'virtual_hosting'
title = ''
lines = ()
have_map = 0
......
......@@ -167,7 +167,7 @@ class VHMAddingTests(unittest.TestCase):
from Products.SiteAccess.VirtualHostMonster import \
manage_addVirtualHostMonster
from zExceptions import BadRequest
self.root._setObject('VHM', Folder('VHM'))
self.root._setObject('virtual_hosting', Folder('virtual_hosting'))
vhm1 = self._makeOne()
self.assertRaises(BadRequest, vhm1.manage_addToContainer, self.root)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment