mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-30 05:07:01 -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:
@@ -1,8 +1,11 @@
|
||||
from rest_framework import viewsets, permissions, filters
|
||||
from django_filters.rest_framework import DjangoFilterBackend
|
||||
from rest_framework import filters, permissions, viewsets
|
||||
|
||||
from apps.core.permissions import IsOwnerOrReadOnly
|
||||
|
||||
from .models import Review
|
||||
from .serializers import ReviewSerializer
|
||||
from apps.core.permissions import IsOwnerOrReadOnly
|
||||
|
||||
|
||||
class ReviewViewSet(viewsets.ModelViewSet):
|
||||
queryset = Review.objects.filter(is_public=True)
|
||||
@@ -14,8 +17,8 @@ class ReviewViewSet(viewsets.ModelViewSet):
|
||||
ordering = ["-created_at"]
|
||||
|
||||
def get_queryset(self):
|
||||
# Users can see their own non-public reviews?
|
||||
# Standard queryset is public only.
|
||||
# Users can see their own non-public reviews?
|
||||
# Standard queryset is public only.
|
||||
# But if we want authors to see their own pending/private reviews:
|
||||
qs = Review.objects.filter(is_public=True)
|
||||
if self.request.user.is_authenticated:
|
||||
|
||||
Reference in New Issue
Block a user