undo_checkout()

Undoes a document checkout via DMS.UndoCheckOutDocument. Releases the lock placed by checkout() without checking in any changes.

1. Signature

  • Sync

  • Async

ecm.dms.undo_checkout(
    model: ECMDocumentModel | int,
    object_type_id: int | None = None,
) -> None
await ecm.dms.undo_checkout(
    model: ECMDocumentModel | int,
    object_type_id: int | None = None,
) -> None

2. Parameters

Parameter Type Default Description

model

ECMDocumentModel | int

 — 

Either an ECMDocumentModel instance (its id is used) or a plain integer document object ID.

object_type_id

int | None

None

The numeric object type ID. If None, the type is extracted from the model instance when available, or resolved via get_object_type_by_id() for plain integer IDs.

3. Return value

None.

4. Exceptions

Exception Condition

ValueError

model is an ECMDocumentModel instance with id set to None.

ECMNotFoundException

object_type_id is None and no object with the given ID exists on the server.

ECMWrongStateException

The document is not currently checked out.

5. Examples

5.1. Undo checkout of a document

  • Sync

  • Async

ecm.dms.undo_checkout(doc)
await ecm.dms.undo_checkout(doc)

5.2. Undo checkout by plain ID

  • Sync

  • Async

ecm.dms.undo_checkout(12345, object_type_id=327685)
await ecm.dms.undo_checkout(12345, object_type_id=327685)

6. See also

  • checkout() — Check out a document

  • files() — Download the files of a document