Skip to content

Recordsetitem nested update fails with KeyError because it has no version field #8725

Open

Description

@rijulpoudel

Description

Updating a record set with an existing Recordsetitem inside recordsetitems fails with KeyError: 'version'.

update_or_create_resource assumes every nested item with an id has a version field. Recordsetitem has an id but no version column.

Steps to reproduce

  1. Create a record set with two Collection Objects.
  2. Get the record set and its item IDs:
    • GET /api/specify/recordset/{id}/
    • GET /api/specify/recordsetitem/?recordset={id}
  3. Send an update with one existing item. The item has an id but no version:
{
  "version": 0,
  "recordsetitems": [
    {
      "id": 123,
      "recordid": 456
    }
  ]
}
PUT /api/specify/recordset/{id}/
  1. The request returns 500:
{
  "exception": "KeyError",
  "message": "version"
}

Expected

A model without a version field should not be treated as versioned. The existing Recordsetitem should update without optimistic locking, or the API should return a clear error.

Notes

Activity

  1. rijulpoudel commented on Oct 28, 2026

    @rijulpoudel
    MemberAuthor

    Reproduced in the local Tables API.

    Request: PUT /api/specify/recordset/2058/

    The body includes recordsetitems[0].id but no nested version.

    500 KeyError version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions