Skip to content

Commit

Permalink
Fix datastore transaction sample (#602)
Browse files Browse the repository at this point in the history
Change-Id: Id8ba648198f87c4d015593f091b368fdbea973cc
  • Loading branch information
Jon Wayne Parrott authored Oct 21, 2016
1 parent d0e0042 commit 2d67133
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion datastore/api/snippets.py
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,8 @@ def transactional_update(client):
# [START transactional_update]
def transfer_funds(client, from_key, to_key, amount):
with client.transaction():
from_account, to_account = client.get_multi([from_key, to_key])
from_account = client.get(from_key)
to_account = client.get(to_key)

from_account['balance'] -= amount
to_account['balance'] += amount
Expand Down

0 comments on commit 2d67133

Please sign in to comment.