From 15cf0e6336794088ca17ec0536571b6a1c2f0794 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Katja=20S=C3=BCss?= Date: Wed, 21 Jun 2017 12:15:32 +0200 Subject: [PATCH] Removed dependency on plone.api. Following style guidelines: one import per line --- plone/app/discussion/interfaces.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/plone/app/discussion/interfaces.py b/plone/app/discussion/interfaces.py index ead8040..5799602 100644 --- a/plone/app/discussion/interfaces.py +++ b/plone/app/discussion/interfaces.py @@ -1,15 +1,19 @@ # -*- coding: utf-8 -*- """Interfaces for plone.app.discussion """ -from plone import api from plone.app.discussion import _ +from Products.CMFCore.interfaces import ISiteRoot +from Products.CMFCore.utils import getToolByName from zope import schema +from zope.component import getUtility from zope.component.interfaces import IObjectEvent -from zope.interface import Interface, Invalid +from zope.interface import Interface +from zope.interface import Invalid from zope.interface.common.mapping import IIterableMapping def isEmail(value): - reg_tool = api.portal.get_tool(name='portal_registration') + portal = getUtility(ISiteRoot) + reg_tool = getToolByName(portal, 'portal_registration') if not (value and reg_tool.isValidEmail(value)): raise Invalid(_("Invalid email address.")) return True