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 ...@@ -30,6 +30,8 @@ Features Added
Restructuring Restructuring
+++++++++++++ +++++++++++++
- Change VHM id to `virtual_hosting` to match AppInitializer.
- Raise BadRequest instead of returning MessageDialog. - Raise BadRequest instead of returning MessageDialog.
- Remove property management ZMI screens. - Remove property management ZMI screens.
......
...@@ -31,8 +31,10 @@ from OFS import bbb ...@@ -31,8 +31,10 @@ from OFS import bbb
from OFS.metaconfigure import get_packages_to_initialize from OFS.metaconfigure import get_packages_to_initialize
from OFS.metaconfigure import package_initialized from OFS.metaconfigure import package_initialized
from OFS.userfolder import UserFolder from OFS.userfolder import UserFolder
from zExceptions import Redirect as RedirectException, Forbidden from zExceptions import (
Forbidden,
Redirect as RedirectException,
)
from zope.interface import implements from zope.interface import implements
import Folder import Folder
...@@ -270,10 +272,13 @@ class AppInitializer: ...@@ -270,10 +272,13 @@ class AppInitializer:
if 'virtual_hosting' not in app: if 'virtual_hosting' not in app:
from Products.SiteAccess.VirtualHostMonster \ from Products.SiteAccess.VirtualHostMonster \
import VirtualHostMonster import VirtualHostMonster
vhm = VirtualHostMonster() any_vhm = [obj for obj in app.values()
vhm.id = 'virtual_hosting' if isinstance(obj, VirtualHostMonster)]
vhm.addToContainer(app) if not any_vhm:
self.commit('Added virtual_hosting') vhm = VirtualHostMonster()
vhm.id = 'virtual_hosting'
vhm.addToContainer(app)
self.commit('Added virtual_hosting')
def install_products(self): def install_products(self):
return install_products() return install_products()
......
...@@ -24,7 +24,7 @@ class VirtualHostMonster(Persistent, Item, Implicit): ...@@ -24,7 +24,7 @@ class VirtualHostMonster(Persistent, Item, Implicit):
meta_type = 'Virtual Host Monster' meta_type = 'Virtual Host Monster'
priority = 25 priority = 25
id = 'VHM' id = 'virtual_hosting'
title = '' title = ''
lines = () lines = ()
have_map = 0 have_map = 0
......
...@@ -167,7 +167,7 @@ class VHMAddingTests(unittest.TestCase): ...@@ -167,7 +167,7 @@ class VHMAddingTests(unittest.TestCase):
from Products.SiteAccess.VirtualHostMonster import \ from Products.SiteAccess.VirtualHostMonster import \
manage_addVirtualHostMonster manage_addVirtualHostMonster
from zExceptions import BadRequest from zExceptions import BadRequest
self.root._setObject('VHM', Folder('VHM')) self.root._setObject('virtual_hosting', Folder('virtual_hosting'))
vhm1 = self._makeOne() vhm1 = self._makeOne()
self.assertRaises(BadRequest, vhm1.manage_addToContainer, self.root) 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