Background
sync_wikidata_properties is currently only runnable via the management command CLI. Operators need a way to trigger a refresh from the Django admin without SSH access — for example, after Wikidata adds new identifier properties relevant to persons, or to re-sync after enabling new ExternalPlatform entries.
Related to #33 (auto-sync on first run).
Proposed feature
Add a custom Django admin action (or admin view) on ExternalIdentifierPropertyAdmin that:
- Runs
sync_wikidata_properties logic inline (extracted to a callable in models.py or a service module so both the management command and admin action can call it).
- Displays a confirmation page before executing (since the operation takes ~5–10 min and makes external SPARQL calls).
- Reports results: rows created, rows updated, rows unchanged, duration.
- Locks out concurrent runs (atomic flag or DB row lock) to prevent double-execution.
Design note
The sync command logic should be extracted from the management command into a sync_wikidata_properties() service function in src/core/ or src/web/persons/services.py — keeping the management command as a thin wrapper. This makes it callable from the admin action, tests, and future cron tasks (#28) without duplicating SPARQL logic.
Acceptance criteria
Background
sync_wikidata_propertiesis currently only runnable via the management command CLI. Operators need a way to trigger a refresh from the Django admin without SSH access — for example, after Wikidata adds new identifier properties relevant to persons, or to re-sync after enabling newExternalPlatformentries.Related to #33 (auto-sync on first run).
Proposed feature
Add a custom Django admin action (or admin view) on
ExternalIdentifierPropertyAdminthat:sync_wikidata_propertieslogic inline (extracted to a callable inmodels.pyor a service module so both the management command and admin action can call it).Design note
The sync command logic should be extracted from the management command into a
sync_wikidata_properties()service function insrc/core/orsrc/web/persons/services.py— keeping the management command as a thin wrapper. This makes it callable from the admin action, tests, and future cron tasks (#28) without duplicating SPARQL logic.Acceptance criteria
ExternalIdentifierPropertychangelist.