Skip to content

Commit

Permalink
Action Builder Entity Record Insert Name Key Hotfix (#887)
Browse files Browse the repository at this point in the history
* allow for bldr prefix on name key when inserting records

* linted
  • Loading branch information
ydamit authored Sep 6, 2023
1 parent 3e1001b commit 5d64a68
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions parsons/action_builder/action_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 5d64a68

Please sign in to comment.