Skip to content

Commit

Permalink
fix: avoid writing <pywebio.io_ctrl.Output object at 0x...>
Browse files Browse the repository at this point in the history
Attempting to use PyWebIO's HTML formatting function when creating the
"enhanced" summary led to objects getting leaked into the exported CSV
output. The new code avoids the use of `put_html` in favor of more
basic formatting.
  • Loading branch information
mhucka committed Jul 26, 2023
1 parent 90ae962 commit f7139b5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions foliage/lookup_tab.py
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ def holdings_info(iid):
holdings = folio.related_records(iid, IdKind.INSTANCE_ID, RecordKind.HOLDINGS)
num_holdings = len(holdings)
if num_holdings > 1:
prefix = '<br>&nbsp;&nbsp;&bull;&nbsp;'
prefix = '\n  • '
holdings_list = []
for h in holdings:
if 'effectiveLocationId' in h.data:
Expand All @@ -570,7 +570,7 @@ def holdings_info(iid):
loc = location(h, 'permanentLocationId', False)
holdings_list.append(loc + f' (holdings record: {h.id})')
locations = prefix + prefix.join(holdings_list)
return put_html(f'{num_holdings} holdings records in total:{locations}')
return f'{num_holdings} holdings records in total:{locations}'
else:
if record.kind == RecordKind.HOLDINGS:
return '1 (there are no other holdings records on the instance)'
Expand Down

0 comments on commit f7139b5

Please sign in to comment.