feat: Implement MFA authentication, add ride statistics model, and update various services, APIs, and tests across the application.

This commit is contained in:
pacnpal
2025-12-28 17:32:53 -05:00
parent aa56c46c27
commit c95f99ca10
452 changed files with 7948 additions and 6073 deletions

View File

@@ -5,11 +5,14 @@ This module provides media management functionality specific to parks.
"""
import logging
from typing import List, Optional, Dict, Any
from typing import Any
from django.contrib.auth import get_user_model
from django.core.files.uploadedfile import UploadedFile
from django.db import transaction
from django.contrib.auth import get_user_model
from apps.core.services.media_service import MediaService
from ..models import Park, ParkPhoto
User = get_user_model()
@@ -78,7 +81,7 @@ class ParkMediaService:
@staticmethod
def get_park_photos(
park: Park, approved_only: bool = True, primary_first: bool = True
) -> List[ParkPhoto]:
) -> list[ParkPhoto]:
"""
Get photos for a park.
@@ -103,7 +106,7 @@ class ParkMediaService:
return list(queryset)
@staticmethod
def get_primary_photo(park: Park) -> Optional[ParkPhoto]:
def get_primary_photo(park: Park) -> ParkPhoto | None:
"""
Get the primary photo for a park.
@@ -196,7 +199,7 @@ class ParkMediaService:
return False
@staticmethod
def get_photo_stats(park: Park) -> Dict[str, Any]:
def get_photo_stats(park: Park) -> dict[str, Any]:
"""
Get photo statistics for a park.
@@ -217,7 +220,7 @@ class ParkMediaService:
}
@staticmethod
def bulk_approve_photos(photos: List[ParkPhoto], approved_by: User) -> int:
def bulk_approve_photos(photos: list[ParkPhoto], approved_by: User) -> int:
"""
Bulk approve multiple photos.