mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-30 12:07:03 -05:00
feat: Implement MFA authentication, add ride statistics model, and update various services, APIs, and tests across the application.
This commit is contained in:
@@ -4,12 +4,14 @@ Park-specific media models for ThrillWiki.
|
||||
This module contains media models specific to parks domain.
|
||||
"""
|
||||
|
||||
from typing import Any, List, Optional, cast
|
||||
from django.db import models
|
||||
from typing import Any, cast
|
||||
|
||||
import pghistory
|
||||
from django.conf import settings
|
||||
from django.db import models
|
||||
|
||||
from apps.core.history import TrackedModel
|
||||
from apps.core.services.media_service import MediaService
|
||||
import pghistory
|
||||
|
||||
|
||||
def park_photo_upload_path(instance: models.Model, filename: str) -> str:
|
||||
@@ -114,7 +116,7 @@ class ParkPhoto(TrackedModel):
|
||||
super().save(*args, **kwargs)
|
||||
|
||||
@property
|
||||
def file_size(self) -> Optional[int]:
|
||||
def file_size(self) -> int | None:
|
||||
"""Get file size in bytes."""
|
||||
try:
|
||||
return self.image.size
|
||||
@@ -122,7 +124,7 @@ class ParkPhoto(TrackedModel):
|
||||
return None
|
||||
|
||||
@property
|
||||
def dimensions(self) -> Optional[List[int]]:
|
||||
def dimensions(self) -> list[int] | None:
|
||||
"""Get image dimensions as [width, height]."""
|
||||
try:
|
||||
return [self.image.width, self.image.height]
|
||||
|
||||
Reference in New Issue
Block a user