From 917c1fc3cbedf4f9d9ba322c641ce45499c03c3c Mon Sep 17 00:00:00 2001 From: Gabriel Date: Fri, 18 Oct 2024 18:19:37 -0400 Subject: [PATCH] Specify YAML documentation for old_requests in OwnershipRequestManagementViewSet --- backend/clubs/views.py | 49 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/backend/clubs/views.py b/backend/clubs/views.py index 7b641880e..6dc9133e5 100644 --- a/backend/clubs/views.py +++ b/backend/clubs/views.py @@ -3927,6 +3927,55 @@ def accept(self, request, *args, **kwargs): @action(detail=False, methods=["get"], permission_classes=[IsSuperuser]) def old_requests(self, request, *args, **kwargs): + """ + View unaddressed ownership requests that are older than a week. + --- + requestBody: {} + responses: + "200": + content: + application/json: + schema: + type: array + items: + type: object + properties: + club: + type: string + created_at: + type: string + format: date-time + email: + type: string + graduation_year: + type: integer + major: + type: array + items: + type: object + properties: + id: + type: integer + name: + type: string + name: + type: string + school: + type: array + items: + type: object + properties: + id: + type: integer + name: + type: string + is_graduate: + type: boolean + username: + type: string + --- + """ + queryset = OwnershipRequest.objects.filter( withdrawn=False, created_at__lte=timezone.now() - datetime.timedelta(days=7) )