diff --git a/backend/clubs/migrations/0091_cart_ticket.py b/backend/clubs/migrations/0091_cart_ticket.py index 758aa2e30..74ae8cdd9 100644 --- a/backend/clubs/migrations/0091_cart_ticket.py +++ b/backend/clubs/migrations/0091_cart_ticket.py @@ -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 diff --git a/backend/clubs/migrations/0092_auto_20220211_1732.py b/backend/clubs/migrations/0092_auto_20220211_1732.py deleted file mode 100644 index ee9adba59..000000000 --- a/backend/clubs/migrations/0092_auto_20220211_1732.py +++ /dev/null @@ -1,55 +0,0 @@ -# Generated by Django 3.2.8 on 2022-02-11 22:32 - -import django.db.models.deletion -from django.conf import settings -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ("clubs", "0091_ticket"), - ] - - operations = [ - migrations.AddField( - model_name="ticket", - name="held", - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name="ticket", - name="holding_expiration", - field=models.DateTimeField(blank=True, null=True), - ), - migrations.CreateModel( - name="Cart", - fields=[ - ( - "id", - models.AutoField( - auto_created=True, - primary_key=True, - serialize=False, - verbose_name="ID", - ), - ), - ( - "owner", - models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, - related_name="cart", - to=settings.AUTH_USER_MODEL, - ), - ), - ], - ), - migrations.AddField( - model_name="ticket", - name="carts", - field=models.ManyToManyField( - blank=True, related_name="tickets", to="clubs.Cart" - ), - ), - ] diff --git a/backend/clubs/views.py b/backend/clubs/views.py index 550fa3c6d..f8e3bcefd 100644 --- a/backend/clubs/views.py +++ b/backend/clubs/views.py @@ -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 @@ -2263,6 +2271,7 @@ def add_to_cart(self, request, *args, **kwargs): content: application/json: schema: + type: object properties: detail: type: string @@ -2270,6 +2279,7 @@ def add_to_cart(self, request, *args, **kwargs): content: application/json: schema: + type: object properties: detail: type: string @@ -2319,6 +2329,7 @@ def remove_from_cart(self, request, *args, **kwargs): content: application/json: schema: + type: object properties: detail: type: string @@ -2361,7 +2372,7 @@ def buyers(self, request, *args, **kwargs): id: type: string owner_id: - type: int + type: integer type: type: string --- @@ -2455,6 +2466,7 @@ def create_tickets(self, request, *args, **kwargs): content: application/json: schema: + type: object properties: detail: type: string @@ -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: @@ -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 @@ -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) diff --git a/backend/tests/clubs/test_documentation.py b/backend/tests/clubs/test_documentation.py index 01865073a..67bfe8170 100644 --- a/backend/tests/clubs/test_documentation.py +++ b/backend/tests/clubs/test_documentation.py @@ -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(