Skip to content

Commit

Permalink
Work around ipify.org
Browse files Browse the repository at this point in the history
  • Loading branch information
nutjob4life committed Jun 28, 2024
1 parent 426f25b commit 4cc124c
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/eke.knowledge/src/eke/knowledge/wagtail_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,13 @@ def render_html(self, parent_context: list) -> str:
settings = RDFIngest.for_request(self.request)
folders = KnowledgeFolder.objects.all().order_by('ingest_order')

try:
with urlopen(self._ip_service) as f:
my_ip = f.read().decode('utf-8')
except Exception as ex:
my_ip = str(ex)
# ipify.org is having problems
# try:
# with urlopen(self._ip_service) as f:
# my_ip = f.read().decode('utf-8')
# except Exception as ex:
# my_ip = str(ex)
my_ip = 'unknown'

context = {
'last_ingest_start': settings.last_ingest_start,
Expand Down

0 comments on commit 4cc124c

Please sign in to comment.