From b4882c990d277be444f19f9be1a1e0b6d41c77d9 Mon Sep 17 00:00:00 2001 From: aviupadhyayula Date: Fri, 3 Jan 2025 18:11:26 -0800 Subject: [PATCH] Revert to default order limit --- .../0119_alter_ticketsettings_order_limit.py | 18 ++++++++++++++++++ backend/clubs/models.py | 2 +- backend/tests/clubs/test_ticketing.py | 3 --- 3 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 backend/clubs/migrations/0119_alter_ticketsettings_order_limit.py diff --git a/backend/clubs/migrations/0119_alter_ticketsettings_order_limit.py b/backend/clubs/migrations/0119_alter_ticketsettings_order_limit.py new file mode 100644 index 000000000..8d2da40a6 --- /dev/null +++ b/backend/clubs/migrations/0119_alter_ticketsettings_order_limit.py @@ -0,0 +1,18 @@ +# Generated by Django 5.0.4 on 2025-01-04 01:23 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("clubs", "0118_remove_event_ticket_drop_time_and_more"), + ] + + operations = [ + migrations.AlterField( + model_name="ticketsettings", + name="order_limit", + field=models.IntegerField(blank=True, default=10, null=True), + ), + ] diff --git a/backend/clubs/models.py b/backend/clubs/models.py index 6ad0ae8db..dc4432a26 100644 --- a/backend/clubs/models.py +++ b/backend/clubs/models.py @@ -1832,7 +1832,7 @@ class TicketSettings(models.Model): event = models.OneToOneField( Event, on_delete=models.CASCADE, related_name="ticket_settings" ) - order_limit = models.IntegerField(null=True, blank=True) + order_limit = models.IntegerField(null=True, blank=True, default=10) drop_time = models.DateTimeField(null=True, blank=True) fee_charged_to_buyer = models.BooleanField(default=False) diff --git a/backend/tests/clubs/test_ticketing.py b/backend/tests/clubs/test_ticketing.py index 2e8ca9f74..ac6def249 100644 --- a/backend/tests/clubs/test_ticketing.py +++ b/backend/tests/clubs/test_ticketing.py @@ -615,9 +615,6 @@ def test_add_to_cart_twice_accumulates(self): self.assertEqual(cart.tickets.filter(type="premium").count(), 2, cart.tickets) def test_add_to_cart_order_limit_exceeded(self): - self.ticket_settings.order_limit = 10 - self.ticket_settings.save() - self.client.login(username=self.user1.username, password="test") tickets_to_add = {