Skip to content

Incorrect AJAX lookup URLs when parent app is not rooted at / #1012

@vsemionov

Description

@vsemionov

Checklist

  • The bug is reproducible against the latest release or master.
  • There are no similar issues or pull requests to fix it yet.

Describe the bug

When your root (non-admin) app is rooted at /something, the admin app's AJAX lookup endpoint is at /something/admin/...
However, in the generated UI, the actual requests are sent to /admin/... and fail.
It's because the code that generates these URLs doesn't take into account any root path prefix:

view.ajax_lookup_url = urljoin(
    self.base_url + "/", f"{view.identity}/ajax/lookup"
)

Steps to reproduce the bug

No response

Expected behavior

No response

Actual behavior

No response

Debugging material

No response

Environment

MacOS, Python 3.13, SQLAdmin 0.23.0

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    waiting-for-feedbackWaiting feedback/answer/updates from contributor

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions