Skip to content

fix: correct isinstance check for redirect_url in database endpoints#12279

Merged
StpMax merged 1 commit into
mindsdb:releases/26.1.0from
jnMetaCode:fix/databases-redirect-url-isinstance-check
Mar 24, 2026
Merged

fix: correct isinstance check for redirect_url in database endpoints#12279
StpMax merged 1 commit into
mindsdb:releases/26.1.0from
jnMetaCode:fix/databases-redirect-url-isinstance-check

Conversation

@jnMetaCode

Copy link
Copy Markdown
Contributor

Summary

Fixes a bug in where is used instead of .

is always a instance, so always evaluates to . This makes the redirect URL handling completely unreachable in both the and endpoints.

The fix changes to in both locations, which matches the original intent of checking whether the attribute contains a string value before returning the redirect response.

Test plan

  • Verify that with a non-None now correctly triggers the redirect response path
  • Existing tests should continue to pass since this code path was previously unreachable

… status

The condition `isinstance(status, str)` always evaluates to False because
`status` is a HandlerStatusResponse instance, never a str. This makes the
redirect_url handling dead code. The intent was to check whether
`status.redirect_url` is a string.

This bug appears in both the POST /databases and POST /databases/status
endpoints.

Signed-off-by: JiangNan <1394485448@qq.com>
@github-actions

github-actions Bot commented Mar 8, 2026

Copy link
Copy Markdown

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@StpMax

StpMax commented Mar 23, 2026

Copy link
Copy Markdown
Contributor

@jnMetaCode please, leave a comment as described above

@StpMax StpMax self-requested a review March 23, 2026 14:16
@jnMetaCode

Copy link
Copy Markdown
Contributor Author

I have read the CLA Document and I hereby sign the CLA

github-actions Bot added a commit that referenced this pull request Mar 23, 2026
@StpMax StpMax changed the base branch from main to releases/26.1.0 March 24, 2026 12:33
@StpMax StpMax merged commit 6c293dc into mindsdb:releases/26.1.0 Mar 24, 2026
17 of 18 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 24, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants