Skip to content

Commit

Permalink
logging tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
seeker25 committed Dec 11, 2024
1 parent 41ce48e commit b171b29
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions jobs/notebook-report/notebookreport.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ def send_email(file_processing, emailtype, errormessage, partner_code=None):
message.attach(MIMEText("Please see the attachment(s).", "plain"))
process_email_attachments(filenames, message)

return
message["Subject"] = subject
server = smtplib.SMTP(Config.EMAIL_SMTP)
email_list = recipients.strip("][").split(", ")
Expand All @@ -101,8 +102,6 @@ def process_email_attachments(filenames, message):
f"attachment; filename= {file}",
)
file = os.path.join(os.getcwd(), r"data/") + file
print('attaching file: ', file)
print(os.listdir(os.path.join(os.getcwd(), r"data/")))
with open(file, "rb") as attachment:
part.set_payload(attachment.read())
encoders.encode_base64(part)
Expand All @@ -127,7 +126,7 @@ def process_partner_notebooks(notebookdirectory: str, data_dir: str, partner_cod
logging.info("Processing daily notebooks for partner: %s", partner_code)
execute_notebook(notebookdirectory, data_dir, partner_code)

print(f'Monthly report dates: {monthly_report_dates}')
logging.info(f'Monthly report dates: {monthly_report_dates}')
if notebookdirectory == "monthly" and today in monthly_report_dates:
logging.info("Processing monthly notebooks for partner: %s", partner_code)
execute_notebook(notebookdirectory, data_dir, partner_code, is_monthly=True)
Expand Down

0 comments on commit b171b29

Please sign in to comment.