v1
Some checks failed
CI / test (3.11) (push) Failing after 5m36s
CI / build-image (push) Has been skipped

This commit is contained in:
2025-10-22 16:48:55 +02:00
commit 4cefd4e3ab
53 changed files with 5837 additions and 0 deletions

23
server/utils.py Normal file
View File

@@ -0,0 +1,23 @@
"""Common utility helpers for the server package."""
from __future__ import annotations
import uuid
from typing import Iterable, List
def normalize_recipients(value: str | None) -> List[str]:
"""Split a comma separated string of emails into a clean list."""
if not value:
return []
return [item.strip() for item in value.split(",") if item.strip()]
def is_valid_email(value: str) -> bool:
"""Perform a very small sanity check for email addresses."""
value = value.strip()
return bool(value and "@" in value)
def generate_request_id() -> str:
"""Return a UUID4 string for request correlation."""
return str(uuid.uuid4())