Merge pull request #2755 from bblommers/dynamodbstreams_update_item

DynamoDB - Send item to DDB Stream on update, not just on create
This commit is contained in:
Steve Pulec 2020-02-18 18:15:25 -06:00 committed by GitHub
commit d297fc08f2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 70 additions and 1 deletions

View file

@ -1406,6 +1406,7 @@ class DynamoDBBackend(BaseBackend):
range_value = None
item = table.get_item(hash_value, range_value)
orig_item = copy.deepcopy(item)
if not expected:
expected = {}
@ -1439,6 +1440,8 @@ class DynamoDBBackend(BaseBackend):
)
else:
item.update_with_attribute_updates(attribute_updates)
if table.stream_shard is not None:
table.stream_shard.add(orig_item, item)
return item
def delete_item(