Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
docs
  • Loading branch information
knap1930 committed Feb 10, 2024
commit 7f757fb44ad06fa8436facf157c4ed96ddfe0b53
5 changes: 4 additions & 1 deletion docs/transaction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ Now, say you make another attempt to debit one of the accounts when they don't h
condition=(
(BankStatement.account_balance >= transfer_amount) &
(BankStatement.is_active == True)
)
),
return_values=ALL_OLD
)
transaction.update(
BankStatement(user_id='user2'),
Expand All @@ -107,6 +108,8 @@ Now, say you make another attempt to debit one of the accounts when they don't h
assert e.cause_response_code == 'TransactionCanceledException'
# the first 'update' was a reason for the cancellation
assert e.cancellation_reasons[0].code == 'ConditionalCheckFailed'
# when return_values=ALL_OLD, the old values can be accessed from the item property
assert BankStatement.from_dynamodb_dict(e.cancellation_reasons[0].item) == user1_statement
# the second 'update' wasn't a reason, but was cancelled too
assert e.cancellation_reasons[1] is None

Expand Down