Skip to content

Commit 237c3f5

Browse files
committed
Update delete file item example to reference first file
1 parent 46461b7 commit 237c3f5

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

example/example.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -525,10 +525,12 @@ async def create_attach_and_delete_file_field_item(client: Client, vault_id: str
525525
# Delete a file field from an item
526526
deleted_file_item = await client.items.files.delete(
527527
attached_item,
528-
attached_item.files[1].section_id,
529-
attached_item.files[1].field_id,
528+
attached_item.files[0].section_id,
529+
attached_item.files[0].field_id,
530+
)
531+
print(
532+
f"Deleted file '{attached_item.files[0].attributes.name}' from item '{deleted_file_item.title}'."
530533
)
531-
print(f"Deleted file '{file.attributes.name}' from item '{deleted_file_item.title}'.")
532534
# [developer-docs.sdk.python.delete-file-field-item]-end
533535

534536
await client.items.delete(deleted_file_item.vault_id, deleted_file_item.id)

0 commit comments

Comments
 (0)