fix import: stop deprecation warning

This commit is contained in:
Helmut Merz 2020-05-04 16:30:34 +02:00
parent 61a146a43d
commit 522e40f242
3 changed files with 6 additions and 2 deletions

View file

@ -27,11 +27,11 @@ from zope.app.container.interfaces import IAdding
from zope.app.security.interfaces import IAuthentication, PrincipalLookupError
from zope.cachedescriptors.property import Lazy
from zope.component import adapts
from zope.component.interfaces import ObjectEvent
from zope.dublincore.interfaces import IZopeDublinCore
from zope.event import notify
from zope.interface import implements
from zope.interface import alsoProvides, directlyProvides, directlyProvidedBy
from zope.interface.interfaces import ObjectEvent
from zope.publisher.interfaces.browser import IBrowserRequest
from zope.security.proxy import removeSecurityProxy, isinstance
from zope.traversing.api import getName, getParent

View file

@ -27,7 +27,7 @@ from zope.schema._bootstrapinterfaces import StopValidation
from zope.app.container.constraints import contains, containers
from zope.app.container.interfaces import IContainer, IOrderedContainer
from zope.app.file.interfaces import IImage as IBaseAsset
from zope.component.interfaces import IObjectEvent
from zope.interface.interfaces import IObjectEvent
from zope.size.interfaces import ISized
from cybertools.composer.schema.interfaces import FieldType

View file

@ -68,6 +68,8 @@ workspaceGroupsFolderName = 'gloops_ws'
# checking and querying functions
# TODO: activate canAccessObjectWithOption depending on custom.config
def getOption(obj, option, checkType=True):
opts = component.queryAdapter(adapted(obj), IOptions)
if opts is not None:
@ -75,6 +77,7 @@ def getOption(obj, option, checkType=True):
if opt is True:
return opt
if opt:
# TODO: log
return opt[0]
if not checkType:
return None
@ -86,6 +89,7 @@ def getOption(obj, option, checkType=True):
if opt is True:
return opt
if opt:
# TODO: log
return opt[0]
return None