fix(fc3h): split semicolon-stacked statements (E702) and bridge v-dialog v-model to avoid prop write

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-24 23:37:06 -04:00
parent e78a35d333
commit 718cc79905
6 changed files with 32 additions and 12 deletions
+2 -1
View File
@@ -30,7 +30,8 @@ _BACKUP_SETTINGS_FIELDS = (
def _bad(error: str, *, status: int = 400, **extra):
body = {"error": error}; body.update(extra)
body = {"error": error}
body.update(extra)
return jsonify(body), status
+12 -4
View File
@@ -54,7 +54,9 @@ def backup_db_task(self, *, tag: str | None = None,
kind="db", status="running", tag=tag,
triggered_by=triggered_by, started_at=now, manifest={},
)
session.add(row); session.commit(); session.refresh(row)
session.add(row)
session.commit()
session.refresh(row)
run_id = row.id
try:
@@ -101,7 +103,9 @@ def backup_images_task(self, *, tag: str | None = None,
kind="images", status="running", tag=tag,
triggered_by=triggered_by, started_at=now, manifest={},
)
session.add(row); session.commit(); session.refresh(row)
session.add(row)
session.commit()
session.refresh(row)
run_id = row.id
try:
@@ -156,7 +160,9 @@ def restore_db_task(self, *, source_backup_run_id: int) -> dict:
restored_from_id=src.id,
manifest={"source_sql_path": src.sql_path},
)
session.add(marker); session.commit(); session.refresh(marker)
session.add(marker)
session.commit()
session.refresh(marker)
marker_id = marker.id
sql_path = src.sql_path
@@ -200,7 +206,9 @@ def restore_images_task(self, *, source_backup_run_id: int) -> dict:
restored_from_id=src.id,
manifest={"source_tar_path": src.tar_path},
)
session.add(marker); session.commit(); session.refresh(marker)
session.add(marker)
session.commit()
session.refresh(marker)
marker_id = marker.id
tar_path = src.tar_path
@@ -1,5 +1,9 @@
<template>
<v-dialog v-model="modelValue" max-width="520" persistent>
<v-dialog
:model-value="modelValue"
max-width="520" persistent
@update:model-value="$emit('update:modelValue', $event)"
>
<v-card>
<v-card-title>
{{ action === 'restore' ? 'Restore' : 'Delete' }}
+2 -1
View File
@@ -263,7 +263,8 @@ async def test_delete_wrong_confirm_400(client, _seed_runs):
async def test_delete_correct_confirm_204(client, _seed_runs, db_sync):
list_resp = await client.get("/api/system/backup/runs?limit=1")
row = (await list_resp.get_json())["runs"][0]
rid = row["id"]; kind = row["kind"]
rid = row["id"]
kind = row["kind"]
resp = await client.delete(
f"/api/system/backup/runs/{rid}",
+6 -3
View File
@@ -145,9 +145,12 @@ def test_restore_images_untar_to_parent(tmp_path, fake_subprocess):
def test_unlink_removes_present_files_and_reports(tmp_path):
sql = tmp_path / "x.sql"; sql.write_bytes(b"x")
tar = tmp_path / "x.tar.zst"; tar.write_bytes(b"x")
manifest = tmp_path / "x.json"; manifest.write_text("{}")
sql = tmp_path / "x.sql"
sql.write_bytes(b"x")
tar = tmp_path / "x.tar.zst"
tar.write_bytes(b"x")
manifest = tmp_path / "x.json"
manifest.write_text("{}")
result = backup_service.unlink_artifact_files(
sql_path=str(sql), tar_path=str(tar), manifest_path=str(manifest),
)
+5 -2
View File
@@ -30,7 +30,9 @@ def fake_subprocess_and_images_root(monkeypatch, tmp_path):
)
class _FakeProc:
returncode = 0; stdout = b""; stderr = b""
returncode = 0
stdout = b""
stderr = b""
def _fake_run(cmd, **kwargs):
if cmd[0] == "pg_dump":
@@ -54,7 +56,8 @@ def _seed_backup(db_sync, *, kind, status, started_at, tag=None,
tar_path="/tmp/fake.tar.zst" if kind == "images" else None,
manifest={},
)
db_sync.add(row); db_sync.flush()
db_sync.add(row)
db_sync.flush()
return row.id