mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2026-02-05 10:05:19 -05:00
feat: Implement centralized error capture and handling with new middleware, services, and API endpoints, and add new admin and statistics API views.
This commit is contained in:
@@ -12,6 +12,7 @@ from django.core.files.uploadedfile import UploadedFile
|
||||
from django.db import transaction
|
||||
|
||||
from apps.core.services.media_service import MediaService
|
||||
from apps.core.utils import capture_and_log
|
||||
|
||||
from ..models import Park, ParkPhoto
|
||||
|
||||
@@ -164,7 +165,7 @@ class ParkMediaService:
|
||||
logger.info(f"Photo {photo.pk} approved by user {approved_by.username}")
|
||||
return True
|
||||
except Exception as e:
|
||||
logger.error(f"Failed to approve photo {photo.pk}: {str(e)}")
|
||||
capture_and_log(e, f'Approve park photo {photo.pk}', source='service')
|
||||
return False
|
||||
|
||||
@staticmethod
|
||||
@@ -191,7 +192,7 @@ class ParkMediaService:
|
||||
logger.info(f"Photo {photo_id} deleted from park {park_slug} by user {deleted_by.username}")
|
||||
return True
|
||||
except Exception as e:
|
||||
logger.error(f"Failed to delete photo {photo.pk}: {str(e)}")
|
||||
capture_and_log(e, f'Delete park photo {photo.pk}', source='service')
|
||||
return False
|
||||
|
||||
@staticmethod
|
||||
|
||||
Reference in New Issue
Block a user