|
1 | 1 | from datetime import date, timedelta
|
2 | 2 |
|
3 |
| -from django.contrib.contenttypes.models import ContentType |
4 | 3 | from django.db import transaction
|
5 | 4 | from django.db.models import Case, OuterRef, Prefetch, QuerySet, Subquery, Value, When
|
6 | 5 | from django.shortcuts import get_object_or_404
|
|
13 | 12 | from rest_framework.exceptions import ValidationError
|
14 | 13 | from rest_framework.permissions import IsAuthenticated
|
15 | 14 | from rest_framework.response import Response
|
16 |
| -from timeline_logger.models import TimelineLog |
17 | 15 |
|
18 | 16 | from openarchiefbeheer.logging import logevent
|
19 | 17 | from openarchiefbeheer.utils.paginators import PageNumberPagination
|
|
60 | 58 | )
|
61 | 59 | from .serializers import (
|
62 | 60 | AbortDestructionSerializer,
|
63 |
| - AuditTrailItemSerializer, |
64 | 61 | CoReviewerAssignementSerializer,
|
65 | 62 | DestructionListAssigneeReadSerializer,
|
66 | 63 | DestructionListCoReviewSerializer,
|
|
197 | 194 | request=ReassignementSerializer,
|
198 | 195 | responses={200: None},
|
199 | 196 | ),
|
200 |
| - auditlog=extend_schema( |
201 |
| - tags=["Destruction list"], |
202 |
| - summary=_("Retrieve audit log."), |
203 |
| - description=_("Retrieve the audit log for this destruction list."), |
204 |
| - responses={200: AuditTrailItemSerializer(many=True)}, |
205 |
| - ), |
206 | 197 | mark_ready_review=extend_schema(
|
207 | 198 | tags=["Destruction list"],
|
208 | 199 | summary=_("Mark as ready to review."),
|
@@ -258,8 +249,6 @@ def get_permissions(self):
|
258 | 249 | permission_classes = [IsAuthenticated & CanMarkListAsFinal]
|
259 | 250 | elif self.action == "reassign":
|
260 | 251 | permission_classes = [IsAuthenticated & CanReassignDestructionList]
|
261 |
| - elif self.action == "auditlog": |
262 |
| - permission_classes = [IsAuthenticated] |
263 | 252 | elif self.action == "mark_ready_review":
|
264 | 253 | permission_classes = [IsAuthenticated & CanMarkAsReadyToReview]
|
265 | 254 | elif self.action == "abort_destruction":
|
@@ -359,16 +348,6 @@ def reassign(self, request, *args, **kwargs):
|
359 | 348 | )
|
360 | 349 | return Response()
|
361 | 350 |
|
362 |
| - @action(detail=True, methods=["get"], name="audit_log") |
363 |
| - def auditlog(self, request, *args, **kwargs): |
364 |
| - destruction_list = self.get_object() |
365 |
| - items = TimelineLog.objects.filter( |
366 |
| - content_type=ContentType.objects.get_for_model(DestructionList), |
367 |
| - object_id=destruction_list.pk, |
368 |
| - ) |
369 |
| - serializer = AuditTrailItemSerializer(instance=items, many=True) |
370 |
| - return Response(serializer.data) |
371 |
| - |
372 | 351 | @action(detail=True, methods=["post"], name="mark-ready-review")
|
373 | 352 | def mark_ready_review(self, request, *args, **kwargs):
|
374 | 353 | destruction_list = self.get_object()
|
|
0 commit comments