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

IN: fix import duplicates by using unique meeting link as dedupe key #5094

Merged
merged 2 commits into from
Nov 21, 2024
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
8 changes: 5 additions & 3 deletions scrapers/in/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ def scrape(self):

date_str = meeting["meetingdate"].replace(" ", "")
time_str = meeting["starttime"]
custom_start_string = ""
# Determine the 'when' variable based on the presence of time
if time_str:
time_str = time_str.replace(
Expand All @@ -68,21 +69,22 @@ def scrape(self):
else:
when = dateutil.parser.parse(date_str).date()
all_day = True
if "customstart" in meeting and meeting["customstart"] != "":
custom_start_string = f" - {meeting['customstart']}"

location = meeting["location"] or "See Agenda"
video_url = (
f"https://iga.in.gov/legislative/{self.session}/meeting/watchlive/{_id}"
)
event_name = f"{committee['chamber']}#{committee_name}#{location}#{when}"

event = Event(
name=committee_name,
name=f"{committee_name}{custom_start_string}",
start_date=when,
all_day=all_day,
location_name=location,
classification="committee-meeting",
)
event.dedupe_key = event_name
event.dedupe_key = meeting["link"]
event.add_source(link, note="API details")
name_slug = re.sub("[^a-zA-Z0-9]+", "-", committee_name.lower())

Expand Down
Loading