Skip to content

Commit

Permalink
Exclude internal links from external link property
Browse files Browse the repository at this point in the history
  • Loading branch information
blms committed Dec 5, 2023
1 parent 2554c08 commit e8ef16d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion apps/iiif/manifests/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,11 @@ def external_links(self):
:return: Dict of external links ("related" and "seeAlso")
:rtype: dict
"""
related_links = self.relatedlink_set.all()
# exclude internal links from related link set
related_links = self.relatedlink_set.exclude(
link__icontains=settings.HOSTNAME
)
# dict keys correspond to headings in sidebar
return {
"see_also": [
link.link
Expand Down

0 comments on commit e8ef16d

Please sign in to comment.