From 5964b537bc4d4ff3566ac7e49302111373510437 Mon Sep 17 00:00:00 2001 From: Fred Boniface Date: Thu, 8 Jun 2023 21:45:14 +0100 Subject: [PATCH] Add notes --- src/timetable.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/timetable.py b/src/timetable.py index 27f3774..b4ef9bc 100644 --- a/src/timetable.py +++ b/src/timetable.py @@ -149,8 +149,8 @@ def _insertToDb(data :list, type :str): elif type == "update": for item in data: if item['transactionType'] == "Create": - singleList = [item] - mongo.putTimetable(singleList) + singleList = [item] ### These items should be stored in a list and only + mongo.putTimetable(singleList) ### Put into the databse AFTER deletions. elif item['transactionType'] == "Delete": mongo.deleteTimetableData({'trainUid': item['trainUid'], 'scheduleStartDate': item['scheduleStartDate'], 'stpIndicator': item['stpIndicator']}) ## Also need to consider the STP indicator and end date here else I am deleting LTP services when an STP is meant to be deleted. post_count = mongo.getLength("timetable")