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

Revert "Enable passing identifiers to ActionNetwork upsert_person() #876

Merged
merged 5 commits into from
Sep 21, 2023
Merged
Changes from all commits
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
19 changes: 6 additions & 13 deletions parsons/action_network/action_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,18 @@ def upsert_person(
mobile_number=None,
mobile_status="subscribed",
background_processing=False,
identifiers=None,
**kwargs,
):
"""
Creates or updates a person record. In order to update an existing record instead of
creating a new one, you must supply an email or mobile number which matches a record
in the database.

Identifiers are intentionally not included as an option on
this method, because their use can cause buggy behavior if
they are not globally unique. ActionNetwork support strongly
encourages developers not to use custom identifiers.

`Args:`
email_address:
Either email_address or mobile_number are required. Can be any of the following
Expand Down Expand Up @@ -155,16 +159,6 @@ def upsert_person(
an immediate success, with an empty JSON body, and send your request to the
background queue for eventual processing.
https://actionnetwork.org/docs/v2/#background-processing
identifiers:
List of strings to be used as globally unique
identifiers. Can be useful for matching contacts back
to other platforms and systems. If the identifier
provided is not globally unique in ActionNetwork, it will
simply be ignored and not added to the object. Action Network
also creates its own identifier for each new resouce.
https://actionnetwork.org/docs/v2/#resources
e.g.: ["foreign_system:1", "other_system:12345abcd"]

**kwargs:
Any additional fields to store about the person. Action Network allows
any custom field.
Expand Down Expand Up @@ -229,8 +223,7 @@ def upsert_person(
data["person"]["postal_addresses"] = postal_addresses
if tags is not None:
data["add_tags"] = tags
if identifiers:
data["person"]["identifiers"] = identifiers

data["person"]["custom_fields"] = {**kwargs}
url = f"{self.api_url}/people"
if background_processing:
Expand Down