Skip to content

fix: keep form open and add retry option when import returns no entries#393

Open
Oyelakin-Mercy wants to merge 2 commits intohatnote:masterfrom
Oyelakin-Mercy:fix-round-import-empty-entries
Open

fix: keep form open and add retry option when import returns no entries#393
Oyelakin-Mercy wants to merge 2 commits intohatnote:masterfrom
Oyelakin-Mercy:fix-round-import-empty-entries

Conversation

@Oyelakin-Mercy
Copy link

@Oyelakin-Mercy Oyelakin-Mercy commented Feb 28, 2026

This PR fixes the UX issue where the selected category entries are all disqualified, and the round gets created with no entries. This leaves an empty round behind with no way to recover from the same form. For example, I tried creating a yes/no round with this category, "Images from Wiki Loves Monuments in Belgium", which only has subcategories and no images.
This also fixes #208

Problem:

  1. Round is created in the database
  2. Import runs but returns 0 entries
  3. The warning dialog is shown
  4. User clicks OK
  5. The form closes, and an empty round is left behind

Changes:

frontend/src/components/Round/RoundNew.vue:

  • Keep form open on failed import: When there is an import warning, the dialog now has a "Fix Import" button that keeps the form open instead of closing it
  • Retry import on same round: Added createdRoundId ref to track an already-created round. On retry, the existing round is reused instead of creating a duplicate empty round
  • Delete on cancel: If the user cancels after a failed import, cancelRound() is called automatically to delete the already created empty round before closing the form.

frontend/src/i18n/en.json:

  • Added montage-round-retry-import translation key for the "Retry Import" button label shown after a failed import

montage/admin_endpoints.py:

  • Improved warning messages to be clearer:
    • Empty import: 'No entries were imported. Please fix your import source and try again, or click "Cancel" to delete the empty round.'

To test:

  • Create a round with a category that exists but has no images (the form stays open with a clear warning shown).
  • Fix the category and click "Retry Import". This imports the retries on the same round, and no duplicate round is created.
  • Or click cancel after a failed import so that the empty created round will be deleted automatically
  • Create a round with a category that has images. This will work as before.

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.

Montage File List URL image load interface is broken

2 participants