Add date to email

This commit is contained in:
Fred Boniface 2023-06-06 11:31:32 +01:00
parent dfe5e5830b
commit 8ef0585916
2 changed files with 7 additions and 1 deletions

View File

@ -19,6 +19,7 @@ from email import encoders
from email.mime.base import MIMEBase
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.utils import formatdate
import logger as log
@ -53,6 +54,7 @@ def sendMail(msg_body :str, retry):
message['From'] = smtpFrom
message['To'] = "server-notification-receipt@fjla.uk"
message['Subject'] = "OwlBoard - dbmanager Logs"
message['Data'] = formatdate(localtime = True)
filename = "cif_data"
message.attach(MIMEText(msg_body, "plain"))
if os.path.exists(filename):

View File

@ -56,7 +56,11 @@ def parse(codeList):
for ii in codeList:
if stops == ii['stops'] and code != ii['code']:
log.out(f"Identical stopping pattern found: {ii['code']}","DBUG")
codeList.remove(ii) # Instead of removing, I should add a property (duplicate: true), then I can filter this out on the backend when searching by start and end stations and just use query one for other queries, this means that when searching by code, a perfectly valid code won't show 0 results.
codeList.remove(ii) # Instead of removing, I should add a property (duplicate: true),
# then I can filter this out on the backend when searching by start
# and end stations and just use query one for other queries, this
# means that when searching by code, a perfectly valid code won't
# show 0 results.
tiplocs = []
for iii in stops:
print(iii)