Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions backend/app/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from pathlib import Path
from typing import Any

import emails # type: ignore[import-untyped]
import emails

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In v1.0 they added typing for public API: https://github.com/lavr/python-emails/blob/master/CHANGELOG.md#10

import jwt
from jinja2 import Template
from jwt.exceptions import InvalidTokenError
Expand Down Expand Up @@ -37,7 +37,8 @@ def send_email(
html_content: str = "",
) -> None:
assert settings.emails_enabled, "no provided configuration for email variables"
message = emails.Message(
assert settings.EMAILS_FROM_EMAIL # For type checker

@YuriiMotov YuriiMotov Jul 3, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's already checked in emails_enabled property (see), but here we need this to avoid type checking error

message = emails.message.Message(

@YuriiMotov YuriiMotov Jul 3, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To fix Module "emails" does not explicitly export attribute "Message" [attr-defined]

subject=subject,
html=html_content,
mail_from=(settings.EMAILS_FROM_NAME, settings.EMAILS_FROM_EMAIL),
Expand Down
2 changes: 1 addition & 1 deletion backend/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ dependencies = [
"email-validator<3.0.0.0,>=2.1.0.post1",
"tenacity<10.0.0,>=8.2.3",
"pydantic>2.0",
"emails<1.0,>=0.6",
"emails>=1.1.2,<2.0",
"jinja2<4.0.0,>=3.1.4",
"alembic<2.0.0,>=1.12.1",
"httpx<1.0.0,>=0.25.1",
Expand Down
Loading