Skip to content

fix: use API server URL for site title in "Find data" tab - #119

Merged
paulmueller merged 1 commit into
DCOR-dev:mainfrom
paulmueller-agent:fix-status-widget-scheme
Oct 23, 2026
Merged

paulmueller merged 1 commit into
DCOR-dev:mainfrom
paulmueller-agent:fix-status-widget-scheme

Conversation

@paulmueller-agent

@paulmueller-agent paulmueller-agent commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Problem

In the playground user scenario, the setup wizard stores the server as dcor-dev.mpl.mpg.de, without a scheme. On startup with an empty metadata cache, this was logged:

requests.exceptions.MissingSchema: Invalid URL 'dcor-dev.mpl.mpg.de/api/3/action/status_show': No scheme supplied.

It came from the "Find data" tab (WidgetFindData.__init__), which passed the raw settings value to StatusWidget.get_title(). The status widget itself was not affected: its worker already passes api.server, which CKANAPI normalises (_make_server_url).

Fix

  • WidgetFindData now uses get_ckan_api().server, so the scheme comes from CKANAPI: https:// by default, or http:// if the server is configured that way, e.g. for a local test environment.
  • StatusWidget.get_title() and get_favicon() get docstrings saying that server must be a URL including the scheme (e.g. CKANAPI.server).

(An earlier version of this PR added https:// inside the status widget. As you pointed out, that would be wrong for HTTP-only servers, so it was replaced by this approach.)

Tests

  • New offline tests/test_gui_find_data.py, with isolated QSettings and a mocked get_title. It checks that the panel requests the title for https://dcor-dev.mpl.mpg.de when dcor-dev.mpl.mpg.de is stored, and for http://192.168.122.143 when that is stored. On main, the first case fails.
  • End to end: starting DCOR-Aid in playground mode with an empty cache logs no MissingSchema errors anymore, and the site metadata of dcor-dev is cached.

🤖 Generated with Claude Code

`WidgetFindData` passed the server from the settings to
`StatusWidget.get_title`. In the playground, the server is stored
without scheme ("dcor-dev.mpl.mpg.de"), so fetching the site title
failed with `MissingSchema`. Use `get_ckan_api().server` instead,
which contains the correct scheme (https by default, or http if
configured, e.g. for local test environments), like the status widget
already does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@paulmueller-agent paulmueller-agent changed the title fix: add scheme to server URL in status widget fix: use API server URL for site title in "Find data" tab Oct 23, 2026
@paulmueller
paulmueller merged commit 705f317 into DCOR-dev:main Oct 23, 2026
0 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants