ietf-tools / bibxml-service

Django-based Web service implementing IETF BibXML APIs
https://bib.ietf.org
BSD 3-Clause "New" or "Revised" License
17 stars 19 forks source link

UnboundLocalError: local variable 'external_bibitem' referenced before assignment #269

Open sentry-io[bot] opened 2 years ago

sentry-io[bot] commented 2 years ago

Sentry Issue: BIBXML-SERVICE-X

RefNotFoundError: Not found in indexed sources by docid
  File "main/api.py", line 118, in get_by_docid
    bibitem: BibliographicItem = build_citation_for_docid(
  File "main/query.py", line 451, in build_citation_for_docid
    raise RefNotFoundError("Not found in indexed sources by docid", id)

UnboundLocalError: local variable 'external_bibitem' referenced before assignment
(5 additional frame(s) were not displayed)
...
  File "asgiref/current_thread_executor.py", line 22, in run
    result = self.fn(*self.args, **self.kwargs)
  File "asgiref/sync.py", line 476, in thread_handler
    return func(*args, **kwargs)
  File "django/views/decorators/http.py", line 40, in inner
    return func(request, *args, **kwargs)
  File "main/views.py", line 184, in export_citation
    resp = auth.api(get_by_docid)(request)
  File "main/api.py", line 139, in get_by_docid
    if external_bibitem:

Sample request: https://bib.ietf.org/get-one/export/?docid=draft-gont-tcpm-rfc1948bis&doctype=Internet-Draft%27%5B0%5D&format=relaton