diff --git a/tests/base_test.py b/tests/base_test.py index 116d87f3..7d1a0f4d 100644 --- a/tests/base_test.py +++ b/tests/base_test.py @@ -1,4 +1,3 @@ -from typing import List from unittest import TestCase from faker import Faker @@ -14,7 +13,7 @@ class FlaskTemplateCapture: def __init__(self, app: Flask) -> None: - self.recorded_templates: List[str] = [] + self.recorded_templates: list[str] = [] self.app = app def __enter__(self): @@ -41,7 +40,7 @@ def setUp(self) -> None: self.client = self.app.test_client() self.cli = self.app.test_cli_runner() - def assertTemplateUsed(self, template_name: str, recorded_templates: List[str]): + def assertTemplateUsed(self, template_name: str, recorded_templates: list[str]): self.assertIn(template_name, recorded_templates) def assertTableExists(self, table_name: str): @@ -51,7 +50,7 @@ def assertTableExists(self, table_name: str): result = session.execute(stmt, params=params).scalar_one_or_none() self.assertTrue(result, f"Table {table_name} doesn't exists") - def assertColumnsExists(self, table_name: str, columns_name: List[str]): + def assertColumnsExists(self, table_name: str, columns_name: list[str]): with self.app.sql.get_session() as session: for column_name in columns_name: params = { diff --git a/vtaskr/libs/babel/translations.py b/vtaskr/libs/babel/translations.py index d6e9ac01..959366bf 100644 --- a/vtaskr/libs/babel/translations.py +++ b/vtaskr/libs/babel/translations.py @@ -1,6 +1,6 @@ import os from gettext import GNUTranslations, translation -from typing import List, Union +from typing import Union from babel import Locale @@ -82,12 +82,12 @@ def get_translation( def jinja_install_translation(self, jinja_env, translation: GNUTranslations): jinja_env.install_gettext_translations(translation) - def add_languages(self, languages: Union[List[str], str]): + def add_languages(self, languages: Union[list[str], str]): if isinstance(languages, str): languages = [languages] self.languages.extend(languages) - def add_domains(self, domains: Union[List[str], str]): + def add_domains(self, domains: Union[list[str], str]): if isinstance(domains, str): domains = [domains] self.domains.extend(domains) diff --git a/vtaskr/libs/flask/querystring.py b/vtaskr/libs/flask/querystring.py index 7bdef008..d08d1fed 100644 --- a/vtaskr/libs/flask/querystring.py +++ b/vtaskr/libs/flask/querystring.py @@ -1,7 +1,7 @@ from dataclasses import dataclass, fields, is_dataclass from datetime import date, datetime, time, timedelta from enum import Enum -from typing import Any, List, Optional, _GenericAlias +from typing import Any, Optional, _GenericAlias from urllib.parse import parse_qs @@ -40,7 +40,7 @@ def __str__(self) -> str: class QueryStringFilter: _filters: list = [] _dto_data: Optional[dict] = None - _dto_fields: Optional[List[str]] = None + _dto_fields: Optional[list[str]] = None def __init__(self, query_string: str, dto: Optional[Any] = None): """ @@ -97,7 +97,7 @@ def _cast_filter_value(self, filter: Filter, field_type: Any): for t in field_type.__args__: self._cast_filter_value(filter, t) - def _separate_values(self, values: List[str]) -> List[str]: + def _separate_values(self, values: list[str]) -> list[str]: """Split grouped values in many""" new_values = [] for value in values: @@ -147,7 +147,7 @@ def _parse_key(self, key: str, value: str): return None, None - def get_filters(self) -> List[Filter]: + def get_filters(self) -> list[Filter]: return self._filters def __str__(self) -> str: diff --git a/vtaskr/libs/notifications/emails/base_email.py b/vtaskr/libs/notifications/emails/base_email.py index b8f0ef1c..548cc9a4 100644 --- a/vtaskr/libs/notifications/emails/base_email.py +++ b/vtaskr/libs/notifications/emails/base_email.py @@ -1,13 +1,13 @@ from abc import ABC -from typing import List, Optional +from typing import Optional from vtaskr.libs.notifications.message import AbstractMessage class AbstractBaseEmailContent(AbstractMessage, ABC): from_email: Optional[str] = None - to: List[str] = [] + to: list[str] = [] subject: str = "" text: str = "" html: str = "" - cc: Optional[List[str]] = None + cc: Optional[list[str]] = None diff --git a/vtaskr/libs/notifications/emails/smtpemail.py b/vtaskr/libs/notifications/emails/smtpemail.py index f0e3c4a0..42b27774 100644 --- a/vtaskr/libs/notifications/emails/smtpemail.py +++ b/vtaskr/libs/notifications/emails/smtpemail.py @@ -2,7 +2,7 @@ import ssl from email.message import EmailMessage from smtplib import SMTP_SSL -from typing import List, Optional, Union +from typing import Optional, Union from .base_email import AbstractBaseEmailContent @@ -32,12 +32,12 @@ class SMTPEmail: def __init__( self, from_email: str, - to_emails: Union[List[str], str], + to_emails: Union[list[str], str], subject: str, text: str = "", html: str = "", - cc_emails: Optional[List[str]] = None, - bcc_emails: Optional[List[str]] = None, + cc_emails: Optional[list[str]] = None, + bcc_emails: Optional[list[str]] = None, ) -> None: if not text and not html: raise NoEmailContentError("Error: Email as no content !") diff --git a/vtaskr/libs/secutity/validators.py b/vtaskr/libs/secutity/validators.py index 23544aa8..7b2385fb 100644 --- a/vtaskr/libs/secutity/validators.py +++ b/vtaskr/libs/secutity/validators.py @@ -1,6 +1,6 @@ from gettext import gettext as _ from string import ascii_lowercase, ascii_uppercase, digits, punctuation -from typing import List, Optional +from typing import Optional from email_validator import validate_email @@ -17,7 +17,7 @@ class PasswordComplexityError(Exception): class PasswordChecker: - errors: List[str] = [] + errors: list[str] = [] def check_complexity(self, password: str) -> bool: self.errors = [] diff --git a/vtaskr/libs/sqlalchemy/queryset.py b/vtaskr/libs/sqlalchemy/queryset.py index afb08efd..2a01860f 100644 --- a/vtaskr/libs/sqlalchemy/queryset.py +++ b/vtaskr/libs/sqlalchemy/queryset.py @@ -1,4 +1,4 @@ -from typing import List, TypeVar +from typing import TypeVar from sqlalchemy import delete, not_, select, update @@ -47,7 +47,7 @@ def id(self, id: str): self._query = self._query.where(self.qs_class.id == id) return self - def ids(self, ids: List[str]): + def ids(self, ids: list[str]): self._query = self._query.where(self.qs_class.id.in_(ids)) return self @@ -57,7 +57,7 @@ def page(self, page_number: int, per_page: int = 100) -> TQueryset: self._query = self._query.offset(offset).limit(per_page) return self - def from_filters(self, filters: List[Filter]) -> TQueryset: + def from_filters(self, filters: list[Filter]) -> TQueryset: """ Build a query statement from query string filters """ @@ -66,7 +66,7 @@ def from_filters(self, filters: List[Filter]) -> TQueryset: self._add_page(filters) return self - def _add_where(self, filters: List[Filter]) -> None: + def _add_where(self, filters: list[Filter]) -> None: """Apply a where clause according to filters""" [ self._add_simple_where_clause(f) @@ -118,7 +118,7 @@ def _add_simple_where_clause(self, f: Filter): not_(getattr(self.qs_class, f.field).endswith(f.value)) ) - def _add_composed_where_clause(self, fs: List[Filter], operation: Operations): + def _add_composed_where_clause(self, fs: list[Filter], operation: Operations): fields = {f.field for f in fs} for field in fields: values = [f.value for f in fs if f.field == field] @@ -131,7 +131,7 @@ def _add_composed_where_clause(self, fs: List[Filter], operation: Operations): getattr(self.qs_class, field).notin_(values) ) - def _add_order_by(self, filters: List[Filter]) -> None: + def _add_order_by(self, filters: list[Filter]) -> None: """Apply order by clauses found in filters""" order_by_filters = [ @@ -147,7 +147,7 @@ def _add_order_by(self, filters: List[Filter]) -> None: getattr(self.qs_class, order.field).asc() ) - def _add_page(self, filters: List[Filter]) -> None: + def _add_page(self, filters: list[Filter]) -> None: """ Apply pagination constraints offset and page cannot be used together diff --git a/vtaskr/tasks/hmi/dto/tag.py b/vtaskr/tasks/hmi/dto/tag.py index 179324b8..0df4e5a4 100644 --- a/vtaskr/tasks/hmi/dto/tag.py +++ b/vtaskr/tasks/hmi/dto/tag.py @@ -1,5 +1,5 @@ from dataclasses import asdict, dataclass -from typing import List, Optional +from typing import Optional from vtaskr.libs.openapi.base import openapi from vtaskr.tasks.models import Color, Tag @@ -41,7 +41,7 @@ def model_to_dto(cls, tag: Tag) -> TagDTO: ) @classmethod - def list_models_to_list_dto(cls, tags: List[Tag]) -> List[TagDTO]: + def list_models_to_list_dto(cls, tags: list[Tag]) -> list[TagDTO]: return [TagMapperDTO.model_to_dto(t) for t in tags] @classmethod @@ -61,5 +61,5 @@ def dto_to_dict(cls, tag_dto: TagDTO) -> dict: return asdict(tag_dto) @classmethod - def list_dto_to_dict(cls, tags_dto: List[TagDTO]) -> List[dict]: + def list_dto_to_dict(cls, tags_dto: list[TagDTO]) -> list[dict]: return [asdict(tag_dto) for tag_dto in tags_dto] diff --git a/vtaskr/tasks/hmi/dto/task.py b/vtaskr/tasks/hmi/dto/task.py index 6e3b272e..94343213 100644 --- a/vtaskr/tasks/hmi/dto/task.py +++ b/vtaskr/tasks/hmi/dto/task.py @@ -1,6 +1,6 @@ from dataclasses import asdict, dataclass from datetime import datetime, timedelta -from typing import List, Optional +from typing import Optional from vtaskr.libs.openapi.base import openapi from vtaskr.tasks.models import Task @@ -50,7 +50,7 @@ def model_to_dto(cls, task: Task) -> TaskDTO: ) @classmethod - def list_models_to_list_dto(cls, tasks: List[Task]) -> List[TaskDTO]: + def list_models_to_list_dto(cls, tasks: list[Task]) -> list[TaskDTO]: return [TaskMapperDTO.model_to_dto(t) for t in tasks] @classmethod @@ -87,5 +87,5 @@ def dto_to_dict(cls, task_dto: TaskDTO) -> dict: return asdict(task_dto) @classmethod - def list_dto_to_dict(cls, tasks_dto: List[TaskDTO]) -> List[dict]: + def list_dto_to_dict(cls, tasks_dto: list[TaskDTO]) -> list[dict]: return [asdict(task_dto) for task_dto in tasks_dto] diff --git a/vtaskr/tasks/hmi/ports/tag_port.py b/vtaskr/tasks/hmi/ports/tag_port.py index bd449201..43d9afd2 100644 --- a/vtaskr/tasks/hmi/ports/tag_port.py +++ b/vtaskr/tasks/hmi/ports/tag_port.py @@ -1,12 +1,12 @@ from abc import ABC, abstractmethod -from typing import List, Optional +from typing import Optional from vtaskr.tasks.models import Tag class AbstractTagPort(ABC): @abstractmethod - def get_user_tags(self, user_id: str) -> List[dict]: + def get_user_tags(self, user_id: str) -> list[dict]: raise NotImplementedError() @abstractmethod @@ -14,7 +14,7 @@ def get_user_tag(self, user_id: str, tag_id: str) -> Optional[Tag]: raise NotImplementedError() @abstractmethod - def get_user_task_tags(self, user_id: str, task_id: str) -> List[Tag]: + def get_user_task_tags(self, user_id: str, task_id: str) -> list[Tag]: raise NotImplementedError() @abstractmethod diff --git a/vtaskr/tasks/hmi/ports/task_port.py b/vtaskr/tasks/hmi/ports/task_port.py index 43edf232..7445b202 100644 --- a/vtaskr/tasks/hmi/ports/task_port.py +++ b/vtaskr/tasks/hmi/ports/task_port.py @@ -1,18 +1,18 @@ from abc import ABC, abstractmethod -from typing import List, Optional +from typing import Optional from vtaskr.tasks.models import Task class AbstractTaskPort(ABC): @abstractmethod - def get_user_tasks(self, user_id: str) -> List[dict]: + def get_user_tasks(self, user_id: str) -> list[dict]: raise NotImplementedError() def get_user_task(self, user_id: str, task_id: str) -> Optional[Task]: raise NotImplementedError() - def get_user_tag_tasks(self, user_id: str, tag_id: str) -> List[Task]: + def get_user_tag_tasks(self, user_id: str, tag_id: str) -> list[Task]: raise NotImplementedError() def update_user_task(self, user_id: str, task: Task): diff --git a/vtaskr/tasks/hmi/tags_service.py b/vtaskr/tasks/hmi/tags_service.py index 3f7c43c7..c67022d2 100644 --- a/vtaskr/tasks/hmi/tags_service.py +++ b/vtaskr/tasks/hmi/tags_service.py @@ -1,4 +1,4 @@ -from typing import List, Optional +from typing import Optional from sqlalchemy.orm import Session @@ -14,14 +14,14 @@ def __init__(self, session: Session) -> None: self.tag_db = TagDB() self.control = PermissionControl() - def get_user_tags(self, user_id: str) -> List[dict]: + def get_user_tags(self, user_id: str) -> list[dict]: return self.tag_db.user_tags(self.session, user_id) def get_user_tag(self, user_id: str, tag_id: str) -> Optional[Tag]: tag = self.tag_db.load(self.session, tag_id) return tag if self.control.is_owner(user_id, tag.user_id) else None - def get_user_task_tags(self, user_id: str, task_id: str) -> List[Tag]: + def get_user_task_tags(self, user_id: str, task_id: str) -> list[Tag]: return self.tag_db.user_task_tags(self.session, user_id, task_id) def update_user_tag(self, user_id: str, tag: Tag): diff --git a/vtaskr/tasks/hmi/tasks_service.py b/vtaskr/tasks/hmi/tasks_service.py index 30bcdd69..ff6e4290 100644 --- a/vtaskr/tasks/hmi/tasks_service.py +++ b/vtaskr/tasks/hmi/tasks_service.py @@ -1,4 +1,4 @@ -from typing import List, Optional +from typing import Optional from sqlalchemy.orm import Session @@ -16,8 +16,8 @@ def __init__(self, session: Session) -> None: self.control = PermissionControl() def get_user_tasks( - self, user_id: str, qs_filters: Optional[List[Filter]] = None - ) -> List[dict]: + self, user_id: str, qs_filters: Optional[list[Filter]] = None + ) -> list[dict]: return self.task_db.user_tasks(self.session, user_id, qs_filters) def get_user_task(self, user_id: str, task_id: str) -> Optional[Task]: @@ -25,11 +25,11 @@ def get_user_task(self, user_id: str, task_id: str) -> Optional[Task]: return task if self.control.is_owner(user_id, task.user_id) else None def get_user_tag_tasks( - self, user_id: str, tag_id: str, qs_filters: Optional[List[Filter]] = None - ) -> List[Task]: + self, user_id: str, tag_id: str, qs_filters: Optional[list[Filter]] = None + ) -> list[Task]: return self.task_db.user_tag_tasks(self.session, user_id, tag_id, qs_filters) - def set_task_tags(self, user_id: str, task: Task, tags_id: List[str]): + def set_task_tags(self, user_id: str, task: Task, tags_id: list[str]): if self.control.is_owner(user_id, task.user_id): self.task_db.user_add_tags(self.session, user_id, task, tags_id) diff --git a/vtaskr/tasks/models/tag.py b/vtaskr/tasks/models/tag.py index 11dc629c..e8871755 100644 --- a/vtaskr/tasks/models/tag.py +++ b/vtaskr/tasks/models/tag.py @@ -1,7 +1,7 @@ from dataclasses import dataclass from datetime import datetime from re import fullmatch -from typing import Any, List, Optional, TypeVar +from typing import Any, Optional, TypeVar from pytz import utc @@ -48,7 +48,7 @@ class Tag: user_id: str = "" title: str = "" color: Optional[Color] = None - tasks: Optional[List[Any]] = None + tasks: Optional[list[Any]] = None def __init__( self, @@ -57,7 +57,7 @@ def __init__( color: Optional[Color] = None, id: Optional[str] = None, created_at: Optional[datetime] = None, - tasks: Optional[List[Any]] = None, + tasks: Optional[list[Any]] = None, ) -> None: self.id = id or get_id() self.created_at = created_at or datetime.now(utc) @@ -69,7 +69,7 @@ def __init__( def add_tasks(self, tasks: list): self.tasks.extend(tasks) - def remove_tasks(self, tasks_id: List[str]): + def remove_tasks(self, tasks_id: list[str]): self.tasks = [t for t in self.tasks if t.id not in tasks_id] def __str__(self) -> str: diff --git a/vtaskr/tasks/models/task.py b/vtaskr/tasks/models/task.py index 17cc375d..bed14ba0 100644 --- a/vtaskr/tasks/models/task.py +++ b/vtaskr/tasks/models/task.py @@ -1,7 +1,7 @@ from dataclasses import dataclass from datetime import datetime, timedelta from enum import Enum -from typing import List, Optional, TypeVar +from typing import Optional, TypeVar from pytz import utc @@ -32,7 +32,7 @@ class Task: scheduled_at: Optional[datetime] = None duration: Optional[timedelta] = None done: Optional[datetime] = None - tags: Optional[List[Tag]] = None + tags: Optional[list[Tag]] = None def __init__( self, @@ -46,7 +46,7 @@ def __init__( done: Optional[datetime] = None, id: str = "", created_at: Optional[datetime] = None, - tags: Optional[List[Tag]] = None, + tags: Optional[list[Tag]] = None, ) -> None: self.id = id or get_id() self.created_at = created_at or datetime.now(utc) @@ -72,10 +72,10 @@ def get_eisenhower_flag(self): return EisenhowerFlag.DELEGATE return EisenhowerFlag.DELETE - def add_tags(self, tags: List[Tag]): + def add_tags(self, tags: list[Tag]): self.tags.extend(tags) - def remove_tags(self, tags_id: List[str]): + def remove_tags(self, tags_id: list[str]): self.tags = [t for t in self.tags if t.id not in tags_id] def __str__(self) -> str: diff --git a/vtaskr/tasks/persistence/ports/tag_port.py b/vtaskr/tasks/persistence/ports/tag_port.py index 3834ae93..fc9fe1fd 100644 --- a/vtaskr/tasks/persistence/ports/tag_port.py +++ b/vtaskr/tasks/persistence/ports/tag_port.py @@ -1,5 +1,4 @@ from abc import ABC, abstractmethod -from typing import List from vtaskr.base.persistence import AbstractPort from vtaskr.tasks import Tag @@ -7,9 +6,9 @@ class AbstractTagPort(AbstractPort, ABC): @abstractmethod - def user_tags(self, user_id: str) -> List[Tag]: + def user_tags(self, user_id: str) -> list[Tag]: raise NotImplementedError() @abstractmethod - def user_task_tags(self, user_id: str, task_id: str) -> List[Tag]: + def user_task_tags(self, user_id: str, task_id: str) -> list[Tag]: raise NotImplementedError() diff --git a/vtaskr/tasks/persistence/ports/task_port.py b/vtaskr/tasks/persistence/ports/task_port.py index 49a93fda..59fc4425 100644 --- a/vtaskr/tasks/persistence/ports/task_port.py +++ b/vtaskr/tasks/persistence/ports/task_port.py @@ -1,5 +1,4 @@ from abc import ABC, abstractmethod -from typing import List from vtaskr.base.persistence import AbstractPort from vtaskr.tasks import Task @@ -7,17 +6,17 @@ class AbstractTaskPort(AbstractPort, ABC): @abstractmethod - def user_tasks(self, user_id: str) -> List[Task]: + def user_tasks(self, user_id: str) -> list[Task]: """Retrieve all user's tasks""" raise NotImplementedError() @abstractmethod - def user_tag_tasks(self, user_id: str, tag_id: str) -> List[Task]: + def user_tag_tasks(self, user_id: str, tag_id: str) -> list[Task]: """Retrieve all user's tasks with this tag""" raise NotImplementedError() @abstractmethod - def user_add_tags(self, user_id: str, task: Task, tags_id: List[str]): + def user_add_tags(self, user_id: str, task: Task, tags_id: list[str]): """Bulk add tags to user's task""" raise NotImplementedError() diff --git a/vtaskr/tasks/persistence/sqlalchemy/adapters/tags.py b/vtaskr/tasks/persistence/sqlalchemy/adapters/tags.py index 6ffe0e3d..aa3af82c 100644 --- a/vtaskr/tasks/persistence/sqlalchemy/adapters/tags.py +++ b/vtaskr/tasks/persistence/sqlalchemy/adapters/tags.py @@ -1,4 +1,4 @@ -from typing import List, Optional +from typing import Optional from sqlalchemy.orm import Session @@ -33,8 +33,8 @@ def exists(self, session: Session, id: str) -> bool: return session.query(self.tag_qs.statement.exists()).scalar() def user_tags( - self, session: Session, user_id: str, filters: Optional[List[Filter]] = None - ) -> List[Tag]: + self, session: Session, user_id: str, filters: Optional[list[Filter]] = None + ) -> list[Tag]: """Retrieve all user's tags""" filters = filters or [] @@ -49,8 +49,8 @@ def user_task_tags( session: Session, user_id: str, task_id: str, - filters: Optional[List[Filter]] = None, - ) -> List[Tag]: + filters: Optional[list[Filter]] = None, + ) -> list[Tag]: """Retrieve all user's tags for this task""" filters = filters or [] diff --git a/vtaskr/tasks/persistence/sqlalchemy/adapters/tasks.py b/vtaskr/tasks/persistence/sqlalchemy/adapters/tasks.py index 2a04f644..786edf5d 100644 --- a/vtaskr/tasks/persistence/sqlalchemy/adapters/tasks.py +++ b/vtaskr/tasks/persistence/sqlalchemy/adapters/tasks.py @@ -1,4 +1,4 @@ -from typing import List, Optional +from typing import Optional from sqlalchemy.orm import Session @@ -33,8 +33,8 @@ def exists(self, session: Session, id: str) -> bool: return session.query(self.task_qs.statement.exists()).scalar() def user_tasks( - self, session: Session, user_id: str, filters: Optional[List[Filter]] = None - ) -> List[Task]: + self, session: Session, user_id: str, filters: Optional[list[Filter]] = None + ) -> list[Task]: """Retrieve all user's tasks""" filters = filters or [] @@ -49,8 +49,8 @@ def user_tag_tasks( session: Session, user_id: str, tag_id: str, - filters: Optional[List[Filter]] = None, - ) -> List[Task]: + filters: Optional[list[Filter]] = None, + ) -> list[Task]: """Retrieve all user's tasks with this tag""" filters = filters or [] @@ -65,7 +65,7 @@ def user_add_tags( session: Session, user_id: str, task: Task, - tags_id: List[str], + tags_id: list[str], autocommit: bool = True, ): """Bulk add tags to user's task""" diff --git a/vtaskr/users/hmi/flask/emails/change_email.py b/vtaskr/users/hmi/flask/emails/change_email.py index 55267e8b..754a7b66 100644 --- a/vtaskr/users/hmi/flask/emails/change_email.py +++ b/vtaskr/users/hmi/flask/emails/change_email.py @@ -1,5 +1,5 @@ from gettext import GNUTranslations -from typing import List, Tuple +from typing import Tuple from flask import render_template @@ -11,7 +11,7 @@ class ChangeEmailToOldEmail(AbstractBaseEmailContent): logo = EMAIL_LOGO def __init__( - self, trans: GNUTranslations, to: List[str], first_name: str, code: str + self, trans: GNUTranslations, to: list[str], first_name: str, code: str ) -> None: self._ = trans.gettext self.html = render_template( @@ -62,7 +62,7 @@ class ChangeEmailToNewEmail(AbstractBaseEmailContent): logo = EMAIL_LOGO def __init__( - self, trans: GNUTranslations, to: List[str], first_name: str, hash: str + self, trans: GNUTranslations, to: list[str], first_name: str, hash: str ) -> None: self._ = trans.gettext change_email_link = ( diff --git a/vtaskr/users/hmi/flask/emails/change_password.py b/vtaskr/users/hmi/flask/emails/change_password.py index 16720098..7cc06b83 100644 --- a/vtaskr/users/hmi/flask/emails/change_password.py +++ b/vtaskr/users/hmi/flask/emails/change_password.py @@ -1,5 +1,5 @@ from gettext import GNUTranslations -from typing import List, Tuple +from typing import Tuple from flask import render_template @@ -11,7 +11,7 @@ class ChangePasswordEmail(AbstractBaseEmailContent): logo = EMAIL_LOGO def __init__( - self, trans: GNUTranslations, to: List[str], first_name: str, hash: str + self, trans: GNUTranslations, to: list[str], first_name: str, hash: str ) -> None: self._ = trans.gettext change_email_link = ( diff --git a/vtaskr/users/hmi/flask/emails/login.py b/vtaskr/users/hmi/flask/emails/login.py index a3fa75a7..e90cc3fc 100644 --- a/vtaskr/users/hmi/flask/emails/login.py +++ b/vtaskr/users/hmi/flask/emails/login.py @@ -1,5 +1,5 @@ from gettext import GNUTranslations -from typing import List, Tuple +from typing import Tuple from flask import render_template @@ -11,7 +11,7 @@ class LoginEmail(AbstractBaseEmailContent): logo = EMAIL_LOGO def __init__( - self, trans: GNUTranslations, to: List[str], first_name: str, code: str + self, trans: GNUTranslations, to: list[str], first_name: str, code: str ) -> None: self._ = trans.gettext self.html = render_template( diff --git a/vtaskr/users/hmi/flask/emails/register.py b/vtaskr/users/hmi/flask/emails/register.py index 905af9d2..5eb43862 100644 --- a/vtaskr/users/hmi/flask/emails/register.py +++ b/vtaskr/users/hmi/flask/emails/register.py @@ -1,5 +1,5 @@ from gettext import GNUTranslations -from typing import List, Tuple +from typing import Tuple from flask import render_template @@ -10,7 +10,7 @@ class RegisterEmail(AbstractBaseEmailContent): logo = EMAIL_LOGO - def __init__(self, trans: GNUTranslations, to: List[str], first_name: str) -> None: + def __init__(self, trans: GNUTranslations, to: list[str], first_name: str) -> None: self._ = trans.gettext self.html = render_template( "emails/simple_text.html", **self.email_context(first_name)