From b170c355acad32cca4213512f50bf6888ece25b5 Mon Sep 17 00:00:00 2001 From: PaulNdrei Date: Wed, 4 Dec 2024 18:29:45 +0100 Subject: [PATCH] Fix SMTP_PORT parse if env var empty --- src/galtea/users/user_mail_notifier.py | 2 +- tests/stubs/users.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/galtea/users/user_mail_notifier.py b/src/galtea/users/user_mail_notifier.py index d4aeb05..5c1e9f5 100644 --- a/src/galtea/users/user_mail_notifier.py +++ b/src/galtea/users/user_mail_notifier.py @@ -12,7 +12,7 @@ class UserEmailNotifier: def __init__(self): self.smtp_server = os.getenv("SMTP_SERVER") self.smtp_user = os.getenv("SMTP_USER") - self.smtp_port = int(os.getenv("SMTP_PORT", default=465)) + self.smtp_port = int(os.getenv("SMTP_PORT") or 465) self.smtp_password = os.getenv("SMTP_PASSWORD") self.sender_email = os.getenv("SMTP_SENDER_EMAIL") diff --git a/tests/stubs/users.json b/tests/stubs/users.json index c1f24c4..c473d53 100644 --- a/tests/stubs/users.json +++ b/tests/stubs/users.json @@ -1,3 +1,3 @@ [ - {"first_name": "John", "last_name": "Doe", "email": "andreipetrea3+12345@gmail.com", "role": "annotator"} + {"first_name": "John", "last_name": "Doe", "email": "test@test.com", "role": "annotator"} ] \ No newline at end of file