diff --git a/parsons/action_builder/action_builder.py b/parsons/action_builder/action_builder.py index 2af620d77f..43fd70f1a6 100644 --- a/parsons/action_builder/action_builder.py +++ b/parsons/action_builder/action_builder.py @@ -188,12 +188,11 @@ def insert_entity_record(self, entity_type, data=None, campaign=None): Dict containing Action Builder entity data. """ # noqa: E501 + name_keys = ("name", "action_builder:name", "given_name") error = "Must provide data with name or given_name when inserting new record" if not isinstance(data, dict): raise ValueError(error) - name_check = [ - key for key in data.get("person", {}) if key in ("name", "given_name") - ] + name_check = [key for key in data.get("person", {}) if key in name_keys] if not name_check: raise ValueError(error)