Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion backend/src/baserow/contrib/database/api/rows/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1587,7 +1587,11 @@ class BatchDeleteRowsView(APIView):
]
),
404: get_error_schema(
["ERROR_TABLE_DOES_NOT_EXIST", "ERROR_ROW_DOES_NOT_EXIST"]
[
"ERROR_TABLE_DOES_NOT_EXIST",
"ERROR_ROW_DOES_NOT_EXIST",
"ERROR_VIEW_DOES_NOT_EXIST",
]
),
},
)
Expand All @@ -1603,6 +1607,7 @@ class BatchDeleteRowsView(APIView):
CannotDeleteRowsInTable: ERROR_CANNOT_DELETE_ROWS_IN_TABLE,
DeadlockException: ERROR_DATABASE_DEADLOCK,
FieldDataConstraintException: ERROR_FIELD_DATA_CONSTRAINT,
ViewDoesNotExist: ERROR_VIEW_DOES_NOT_EXIST,
}
)
@atomic_with_retry_on_deadlock()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2380,6 +2380,27 @@ def test_batch_delete_rows_user_not_in_workspace(api_client, data_fixture):
assert response.json()["error"] == "ERROR_USER_NOT_IN_GROUP"


@pytest.mark.django_db
@pytest.mark.api_rows
def test_batch_delete_rows_view_does_not_exist(api_client, data_fixture):
user, jwt_token = data_fixture.create_user_and_token()
table = data_fixture.create_database_table(user=user)
model = table.get_model()
row_1 = model.objects.create()
request_body = {"items": [row_1.id]}
url = reverse("api:database:rows:batch-delete", kwargs={"table_id": table.id})

response = api_client.post(
f"{url}?view=-1",
request_body,
format="json",
HTTP_AUTHORIZATION=f"JWT {jwt_token}",
)

assert response.status_code == HTTP_404_NOT_FOUND, response.json()
assert response.json()["error"] == "ERROR_VIEW_DOES_NOT_EXIST"


@pytest.mark.django_db
@pytest.mark.api_rows
def test_batch_delete_rows_invalid_table_id(api_client, data_fixture):
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"type": "bug",
"message": "Return 404 when view doesn't exist in batch delete rows endpoint.",
"issue_origin": "github",
"issue_number": null,
"domain": "database",
"bullet_points": [],
"created_at": "2026-02-20"
}
Loading