Skip to content

Commit

Permalink
Merge pull request #33 from plone/links-no-intid
Browse files Browse the repository at this point in the history
Handle links that do not have an intid yet
  • Loading branch information
pbauer committed Dec 9, 2015
2 parents 24322d3 + 1c6dff0 commit 4c926ef
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
4 changes: 3 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ New:

Fixes:

- *add item here*
- Handle links that do not have an intid yet. Should help with
upgrade issues.
[vangheem]


3.0.3 (2015-11-26)
Expand Down
12 changes: 11 additions & 1 deletion plone/app/linkintegrity/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,17 @@ def getObjectsFromLinks(base, links):

obj, extra = findObject(base, path)
if obj and not IPloneSiteRoot.providedBy(obj):
objid = intids.getId(obj)
try:
objid = intids.getId(obj)
except KeyError:
try:
intids.register(obj)
objid = intids.getId(obj)
except NotYet:
# if we get a NotYet error, the object is not
# attached yet and we will need to get links
# at a later time when the object has an intid
continue
relation = RelationValue(objid)
objects.add(relation)
return objects
Expand Down

0 comments on commit 4c926ef

Please sign in to comment.