From bfe018cde6dee0ddd1009940e87550c6e756f361 Mon Sep 17 00:00:00 2001 From: Sam Wenham Date: Thu, 18 Apr 2019 19:26:09 +0100 Subject: [PATCH] Clear data issues for logbooks before reloading --- parsers/logbooks.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/parsers/logbooks.py b/parsers/logbooks.py index bf6081f..ad06c8e 100644 --- a/parsers/logbooks.py +++ b/parsers/logbooks.py @@ -326,12 +326,16 @@ def LoadLogbookForExpedition(expedition): def LoadLogbooks(): - """ This is the master function for parsing all logbooks into the Troggle database. Requires yearlinks, which is a list of tuples for each expedition with expedition year, logbook path, and parsing function. """ + """ This is the master function for parsing all logbooks into the Troggle database. """ + # Clear the logbook data issues as we are reloading + models.DataIssue.filter(parser='logbooks').delete() + # Fetch all expos expos = models.Expedition.objects.all() for expo in expos: print("\nLoading Logbook for: " + expo.year) - + + # Load logbook for expo LoadLogbookForExpedition(expo)