Run: black and isort

This commit is contained in:
2025-10-05 02:28:47 +02:00
parent bd3e23da07
commit 6e9f8a0589
12 changed files with 222 additions and 189 deletions

View File

@@ -1,16 +1,20 @@
import logging
from typing import Optional, Dict, Any
from typing import Any, Dict, Optional
from database.interface import DatabaseInterface
from utils.password_utils import PasswordUtils
from utils.validation import ValidationUtils
logger = logging.getLogger(__name__)
class UserService:
def __init__(self, database: DatabaseInterface):
self.db = database
def create_user(self, username: str, email: str, password: str) -> tuple[bool, list[str]]:
def create_user(
self, username: str, email: str, password: str
) -> tuple[bool, list[str]]:
errors = []
# Validierung
@@ -53,7 +57,6 @@ class UserService:
logger.error(f"Error creating user: {e}")
return False, [f"Database error: {str(e)}"]
def get_user_by_email(self, email: str) -> Optional[Dict[str, Any]]:
if not ValidationUtils.validate_email(email):
return None
@@ -70,4 +73,4 @@ class UserService:
return self.db.get_user_by_username(username)
except Exception as e:
logger.error(f"Error getting user by username: {e}")
return None
return None