Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: hotgluexyz/target-everyaction
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: d6b1cbf6bdf8f0f7561db8643f2b8b0c7b4026e0
Choose a base ref
..
head repository: hotgluexyz/target-everyaction
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: a4c6add6797cda5c62ae187269bb37e09420f7f5
Choose a head ref
Showing with 0 additions and 29 deletions.
  1. +0 −29 target_everyaction/sinks.py
29 changes: 0 additions & 29 deletions target_everyaction/sinks.py
Original file line number Diff line number Diff line change
@@ -101,35 +101,6 @@ def _get_or_create_code(self, code_payload: dict) -> Optional[str]:
request_data=code_payload)
return response.json() if response.ok else None

def _get_activist_code_id(self, code_name: str) -> Optional[int]:
"""Get existing activist code ID."""
params = {
"statuses": "Active,Archived",
"$top": 200,
"name": code_name
}

response = self.request_api("GET", endpoint="activistCodes", params=params)
while True:
if response.ok:
data = response.json()
# Look for exact match (case-insensitive)
for item in data["items"]:
if item["name"].lower() == code_name.lower():
return item["activistCodeId"]

# Check if there are more pages
if "nextPageLink" not in data:
break
# Extract next page URL and make request
next_page = data["nextPageLink"].split("?")[1]
response = self.request_api("GET", endpoint=f"activistCodes?{next_page}")
else:
break

LOGGER.warning(f"Activist code '{code_name}' not found")
return None

def _get_all_activist_codes(self) -> dict:
"""Get all activist codes and cache them in memory."""
all_codes = {}