Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Action Builder Entity Record Insert Name Key Hotfix #887

Merged
merged 2 commits into from
Sep 6, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion parsons/action_builder/action_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,12 @@ 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")
key for key in data.get("person", {}) if key in name_keys
]
if not name_check:
raise ValueError(error)
Expand Down
Loading