Add notes

This commit is contained in:
Fred Boniface 2023-06-08 21:45:14 +01:00
parent 0f7693d798
commit 5964b537bc

View File

@ -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")