From f02e89d88699ae1bf199fa5126ee674d2812c554 Mon Sep 17 00:00:00 2001 From: Jesse Mortenson Date: Tue, 10 Dec 2024 15:55:18 -0600 Subject: [PATCH] MT: events: os-core does not consider location for duplicates, match that --- scrapers/mt/events.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scrapers/mt/events.py b/scrapers/mt/events.py index 1fdf406ab3..5dbab0c325 100644 --- a/scrapers/mt/events.py +++ b/scrapers/mt/events.py @@ -79,7 +79,7 @@ def scrape_event(self, url: str): # Check if event already exists in the self._events list # and if so, add data to that instead of creating duplicate - existing_event = self.check_for_existing_event(title, location, when) + existing_event = self.check_for_existing_event(title, when) if existing_event is None: # No existing event found, create one event = Event( @@ -112,12 +112,11 @@ def scrape_event(self, url: str): self._events.append(event) def check_for_existing_event( - self, title: str, location_name: str, start_date: datetime.datetime.date + self, title: str, start_date: datetime.datetime.date ) -> Union[Event, None]: for event in self._events: if ( event.name == title - and event.location["name"] == location_name and event.start_date == start_date ): return event