-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 Fix email sending issue missing "From" field #2926
Changes from all commits
c47ba3e
1b7dbc8
71fa905
f2653d3
1cd1296
b4d0ebe
41e0467
96d72c6
6fab6cd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -42,12 +42,12 @@ class LoginOptions(BaseModel): | |||
LOGIN_REDIRECT: str = "/" | ||||
LOGOUT_REDIRECT: str = "/" | ||||
|
||||
SMTP_SENDER: Optional[str] = None | ||||
SMTP_SENDER: str | ||||
SMTP_HOST: str | ||||
SMTP_PORT: int | ||||
SMTP_TLS_ENABLED: bool = False | ||||
SMTP_USERNAME: Optional[str] = None | ||||
SMTP_PASSWORD: Optional[SecretStr] = None | ||||
SMTP_TLS_ENABLED: bool | ||||
SMTP_USERNAME: Optional[str] = Field(...) | ||||
SMTP_PASSWORD: Optional[SecretStr] = Field(...) | ||||
Comment on lines
+49
to
+50
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @sanderegg yes, this way the field is required, which is what will solve the bug we had. Check
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, it means that the fields need to be provided even if the provided value is |
||||
|
||||
# lifetime limits are in days | ||||
REGISTRATION_CONFIRMATION_LIFETIME: PositiveFloat = 5 * _DAYS | ||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# pylint: disable=unused-argument | ||
import os | ||
from typing import Any, Dict | ||
|
||
from settings_library.email import SMTPSettings | ||
from simcore_service_webserver.login.plugin import LoginOptions | ||
|
||
|
||
def test_smtp_settings(mock_env_devel_environment: Dict[str, Any]): | ||
|
||
settings = SMTPSettings() | ||
|
||
cfg = settings.dict(exclude_unset=True) | ||
|
||
for env_name in cfg: | ||
assert env_name in os.environ | ||
|
||
cfg = settings.dict() | ||
|
||
config = LoginOptions(**cfg) | ||
print(config.json(indent=1)) | ||
|
||
assert config.SMTP_SENDER is not None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Example?? really? is there no better name? 🤣
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
true ..