fix: tilde encode database name in expanded foreign key links (#2476)

* Tilde encode database for expanded foreign key links
* Test for foreign key fix in #2476

---------

Co-authored-by: Simon Willison <swillison@gmail.com>
This commit is contained in:
Jack Stratton 2025-04-16 22:15:11 -07:00 committed by GitHub
commit d5c6e502fb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 1 deletions

View file

@ -273,7 +273,7 @@ async def display_columns_and_rows(
link_template = LINK_WITH_LABEL if (label != value) else LINK_WITH_VALUE
display_value = markupsafe.Markup(
link_template.format(
database=database_name,
database=tilde_encode(database_name),
base_url=base_url,
table=tilde_encode(other_table),
link_id=tilde_encode(str(value)),