From cc31f97bc4b8f8e79f36acbc596e3dcec7d55aa9 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Sat, 10 Aug 2024 09:58:17 -0400 Subject: [PATCH] membershipworks: Delete Events that don't exist in membershipworks during scrape --- membershipworks/tasks/scrape.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/membershipworks/tasks/scrape.py b/membershipworks/tasks/scrape.py index f08505f..1d196a3 100644 --- a/membershipworks/tasks/scrape.py +++ b/membershipworks/tasks/scrape.py @@ -178,3 +178,6 @@ def scrape_events(): event_ext.details = membershipworks.get_event_by_eid(event.eid) event_ext.registrations = membershipworks.get_event_registrations(event.eid) event_ext.save() + + # delete all events that did not occur in the event list + EventExt.objects.exclude(pk__in=events).delete()