ignore empty action key in entity's data

This commit is contained in:
iLLiCiTiT 2020-06-10 18:11:11 +02:00
parent 880e625eb2
commit e17b7cb593
2 changed files with 4 additions and 1 deletions

View file

@ -158,7 +158,7 @@ class FirstVersionStatus(BaseEvent):
filtered_ents = []
for entity in event["data"].get("entities", []):
# Care only about add actions
if entity["action"] != "add":
if entity.get("action") != "add":
continue
# Filter AssetVersions

View file

@ -6,6 +6,9 @@ class ThumbnailEvents(BaseEvent):
"""Updates thumbnails of entities from new AssetVersion."""
for entity in event["data"].get("entities", []):
action = entity.get("action")
if not action:
continue
if (
entity["action"] == "remove"
or entity["entityType"].lower() != "assetversion"