From 673b5100ac6cd206240fca4d9541a7a7176ddb96 Mon Sep 17 00:00:00 2001 From: ramonavic Date: Thu, 2 Jan 2025 16:07:49 +0100 Subject: [PATCH] formatting and mypy --- docker-compose.yml | 2 -- meldingen_core/actions/melding.py | 4 +++- meldingen_core/models.py | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index b9e4c33..d65381e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,5 +1,3 @@ -version: "3" - services: meldingen-core: image: amsterdam/meldingen-core diff --git a/meldingen_core/actions/melding.py b/meldingen_core/actions/melding.py index d7407b9..a4daec0 100644 --- a/meldingen_core/actions/melding.py +++ b/meldingen_core/actions/melding.py @@ -1,6 +1,6 @@ from abc import ABCMeta, abstractmethod from datetime import datetime, timedelta -from typing import Any, Generic, TypeVar, override, Literal +from typing import Any, Generic, Literal, TypeVar, override import structlog @@ -67,6 +67,7 @@ class MeldingRetrieveAction(BaseRetrieveAction[T, T_co]): class MeldingUpdateAction(BaseCRUDAction[T, T_co]): """Action that updates the melding and reclassifies it""" + _verify_token: TokenVerifier[T, T_co] _classify: Classifier _state_machine: BaseMeldingStateMachine[T] @@ -103,6 +104,7 @@ async def __call__(self, pk: int, values: dict[str, Any], token: str) -> T: class MeldingAddContactAction(BaseCRUDAction[T, T_co]): """Action that adds contact information to a melding.""" + _verify_token: TokenVerifier[T, T_co] def __init__( diff --git a/meldingen_core/models.py b/meldingen_core/models.py index 1e9d6f5..8613ce6 100644 --- a/meldingen_core/models.py +++ b/meldingen_core/models.py @@ -15,11 +15,11 @@ class Melding: text: str classification: Classification | None = None + attachments: list["Attachment"] = field(default_factory=list) token: str | None = None token_expires: datetime | None = None - attachments: list["Attachment"] = field(default_factory=list) - email: str | None - phone: str | None + email: str | None = None + phone: str | None = None @dataclass