Products.CMFPlone/plip-1486-redirection: Get redirection storage

Stephan Klinger <jenkins-z4DKO/[email protected]>
Newsgroups gmane.comp.web.zope.plone.cvs
Message-ID <[email protected]>
Repository: Products.CMFPlone
Branch: refs/heads/plip-1486-redirection
Date: 2017-07-10T09:31:40+03:00
Author: Stephan Klinger (staeff) <[email protected]>
Commit: https://github.com/plone/Products.CMFPlone/commit/d62f8c90eb2880ade0f3051322cc7d20038dd98d

Get redirection storage

Files changed:
M Products/CMFPlone/controlpanel/browser/redirects.py

diff --git a/Products/CMFPlone/controlpanel/browser/redirects.py b/Products/CMFPlone/controlpanel/browser/redirects.py
index 20704bdc1..d61d47294 100644
--- a/Products/CMFPlone/controlpanel/browser/redirects.py
+++ b/Products/CMFPlone/controlpanel/browser/redirects.py
@@ -3,7 +3,8 @@
 
 from zope.interface import implementer
 from zope.interface import Interface
-from zope.component import adapts, getUtility
+from zope.component import adapts
+from zope.component import getUtility
 from zope.schema import Choice, Tuple
 
 from AccessControl import getSecurityManager
@@ -18,6 +19,7 @@
 from Products.CMFPlone.interfaces import IPloneSiteRoot
 from plone.app.redirector.interfaces import IRedirectionStorage
 
+
 from z3c.form import form, field
 
 from plone.memoize.instance import memoize
@@ -143,7 +145,7 @@ class RedirectsControlPanelAdapter(object):
 
     def __init__(self, context):
         self.context = context
-        self.rt = getToolByName(context, 'portal_redirection')
+        self.rt = getUtility(IRedirectionStorage)
 
     def get_managed_types(self):
         return self.rt.getRedirectionAllowedForTypes()



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.