Skip to content

Commit

Permalink
Specify YAML documentation for old_requests in OwnershipRequestManage…
Browse files Browse the repository at this point in the history
…mentViewSet
  • Loading branch information
gabeweng committed Oct 18, 2024
1 parent c5b6c4c commit 917c1fc
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions backend/clubs/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(

Check warning on line 3979 in backend/clubs/views.py

View check run for this annotation

Codecov / codecov/patch

backend/clubs/views.py#L3979

Added line #L3979 was not covered by tests
withdrawn=False, created_at__lte=timezone.now() - datetime.timedelta(days=7)
)
Expand Down

0 comments on commit 917c1fc

Please sign in to comment.