Skip to content

Commit

Permalink
Do add deprecation warnings for our own uuidToObject and uuidToURL.
Browse files Browse the repository at this point in the history
  • Loading branch information
mauritsvanrees committed Jun 9, 2022
1 parent 5f74d9b commit 99f0203
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions plone/outputfilters/browser/resolveuid.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from Acquisition import aq_base
from Products.CMFCore.utils import getToolByName
from zExceptions import NotFound
from zope.deprecation import deprecate
from zope.interface import implementer
from zope.publisher.browser import BrowserView
from zope.publisher.interfaces import IPublishTraverse
Expand All @@ -13,6 +14,7 @@
from zope.app.component.hooks import getSite


@deprecate("Please use plone.app.uuid.utils.uuidToURL instead.")
def uuidToURL(uuid):
"""Resolves a UUID to a URL via the UID index of portal_catalog.
"""
Expand All @@ -22,6 +24,10 @@ def uuidToURL(uuid):
return res[0].getURL()


@deprecate(
"Please use plone.app.uuid.utils.uuidToObject instead. "
"But be aware that this does an extra security check."
)
def uuidToObject(uuid):
"""Resolves a UUID to an object via the UID index of portal_catalog.
"""
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ def read(filename):
'setuptools',
'six',
'unidecode',
'zope.deprecation',
'beautifulsoup4',
'lxml',
],
Expand Down

0 comments on commit 99f0203

Please sign in to comment.