refactor: Rename launch_type to propulsion_system across the codebase

This commit is contained in:
pacnpal
2025-09-18 21:01:13 -04:00
parent 516c847377
commit d5cd6ad0a3
21 changed files with 207 additions and 92 deletions

View File

@@ -22,7 +22,7 @@ from drf_spectacular.types import OpenApiTypes
from rest_framework import status
from rest_framework.decorators import action
from rest_framework.exceptions import ValidationError
from rest_framework.permissions import IsAuthenticated
from rest_framework.permissions import IsAuthenticated, AllowAny
from rest_framework.response import Response
from rest_framework.viewsets import ModelViewSet
@@ -109,9 +109,16 @@ class ParkPhotoViewSet(ModelViewSet):
Includes advanced features like bulk approval and statistics.
"""
permission_classes = [IsAuthenticated]
lookup_field = "id"
def get_permissions(self):
"""Set permissions based on action."""
if self.action in ['list', 'retrieve', 'stats']:
permission_classes = [AllowAny]
else:
permission_classes = [IsAuthenticated]
return [permission() for permission in permission_classes]
def get_queryset(self): # type: ignore[override]
"""Get photos for the current park with optimized queries."""
queryset = ParkPhoto.objects.select_related(