Skip to content

Fix backup restore confirmation flow - #84

Draft
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/critical-bug-investigation-096c
Draft

Fix backup restore confirmation flow#84
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/critical-bug-investigation-096c

Conversation

@cursor

@cursor cursor Bot commented Jul 5, 2026

Copy link
Copy Markdown

Bug and impact

The active backup restore page rendered the shared restore template without the backup object it expects, so opening a backup restore page could fail while reversing the form action. If the page did render, the form submitted confirm_restore but the view only checked confirm, preventing operators from restoring backups through the browser.

Root cause

The refactored active backup view passed backup_name/backup_info while the template uses backup.name, and the POST confirmation field diverged from the template checkbox name.

Fix

  • Build and pass the backup context used by the restore template.
  • Accept the real confirm_restore field while preserving the legacy confirm field.
  • Add regression coverage for rendering the restore page and restoring via the UI field.

Validation

  • mkdir -p logs && .venv/bin/python manage.py test inventory.tests.test_views.BackupViewSecurityTest
  • mkdir -p logs && .venv/bin/python manage.py check

Both passed; manage.py check only reports the existing staticfiles.W004 warning for missing /workspace/static.

Open in Web View Automation 

cursoragent and others added 2 commits July 5, 2026 11:12
Co-authored-by: Xianist Lab <zhtyyx@users.noreply.github.com>
Co-authored-by: Xianist Lab <zhtyyx@users.noreply.github.com>
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.

1 participant