Skip to content

Commit

Permalink
rebase, fix some documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
rohangpta committed Nov 12, 2022
1 parent 7367db1 commit 7f650dc
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 67 deletions.
2 changes: 1 addition & 1 deletion backend/clubs/migrations/0091_cart_ticket.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Generated by Django 3.2.8 on 2022-10-02 16:50
# Generated by Django 3.2.8 on 2022-11-12 20:05

import uuid

Expand Down
55 changes: 0 additions & 55 deletions backend/clubs/migrations/0092_auto_20220211_1732.py

This file was deleted.

30 changes: 20 additions & 10 deletions backend/clubs/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,17 @@
from django.core.serializers.json import DjangoJSONEncoder
from django.core.validators import validate_email
from django.db import transaction
from django.db.models import Count, DurationField, ExpressionWrapper, F, Prefetch, Q
from django.db.models import (
Count,
DurationField,
ExpressionWrapper,
F,
Prefetch,
Q,
TextField,
)
from django.db.models.expressions import RawSQL, Value
from django.db.models.functions import Lower, Trunc
from django.db.models.functions import SHA1, Lower, Trunc
from django.db.models.functions.text import Concat
from django.db.models.query import prefetch_related_objects
from django.http import HttpResponse
Expand Down Expand Up @@ -2263,13 +2271,15 @@ def add_to_cart(self, request, *args, **kwargs):
content:
application/json:
schema:
type: object
properties:
detail:
type: string
"403":
content:
application/json:
schema:
type: object
properties:
detail:
type: string
Expand Down Expand Up @@ -2319,6 +2329,7 @@ def remove_from_cart(self, request, *args, **kwargs):
content:
application/json:
schema:
type: object
properties:
detail:
type: string
Expand Down Expand Up @@ -2361,7 +2372,7 @@ def buyers(self, request, *args, **kwargs):
id:
type: string
owner_id:
type: int
type: integer
type:
type: string
---
Expand Down Expand Up @@ -2455,6 +2466,7 @@ def create_tickets(self, request, *args, **kwargs):
content:
application/json:
schema:
type: object
properties:
detail:
type: string
Expand Down Expand Up @@ -2496,6 +2508,7 @@ def upload(self, request, *args, **kwargs):
description: Returned if the file was successfully uploaded.
content: &upload_resp
application/json:
schema:
type: object
properties:
detail:
Expand Down Expand Up @@ -4565,17 +4578,13 @@ def checkout(self, request, *args, **kwargs):
NOTE: this does NOT buy tickets, it simply initiates a checkout process
which includes a 10-minute ticket hold
---
requestBody:
content:
application/json:
schema:
type: object
requestBody: {}
responses:
"200":
content:
application/json:
schema:
type: object
properties:
detail:
type: string
Expand Down Expand Up @@ -4612,10 +4621,11 @@ def checkout_success_callback(self, request, *args, **kwargs):
content:
application/json:
schema:
type: object
properties:
detail:
type: string
---
"""
cart = get_object_or_404(Cart, owner=self.request.user)

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

View check run for this annotation

Codecov / codecov/patch

backend/clubs/views.py#L4630

Added line #L4630 was not covered by tests

Expand Down
2 changes: 1 addition & 1 deletion backend/tests/clubs/test_documentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,8 @@ def test_openapi_docs(self):
)
if "application/json" in content["content"]:
json_content = content["content"]["application/json"]
self.assertTrue("schema" in json_content)
try:
self.assertTrue("schema" in json_content)
self.verify_schema(json_content["schema"])
except AssertionError as e:
raise AssertionError(
Expand Down

0 comments on commit 7f650dc

Please sign in to comment.