diff --git a/api/views.py b/api/views.py index eced1a2..f18d414 100644 --- a/api/views.py +++ b/api/views.py @@ -111,7 +111,7 @@ def _get_meal_type(self, time): if meal_timing.start_time <= time <= meal_timing.end_time: return meal_type except MessTiming.DoesNotExist: - return None + continue return None def _filter_valid_cards(self, cards, meal_type): diff --git a/home/migrations/0010_alter_allocation_first_pref_and_more.py b/home/migrations/0010_alter_allocation_first_pref_and_more.py new file mode 100644 index 0000000..91a1e68 --- /dev/null +++ b/home/migrations/0010_alter_allocation_first_pref_and_more.py @@ -0,0 +1,28 @@ +# Generated by Django 5.0.13 on 2026-01-30 08:33 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('home', '0009_student_photo'), + ] + + operations = [ + migrations.AlterField( + model_name='allocation', + name='first_pref', + field=models.CharField(blank=True, default=None, help_text='This contians the first preference caterer of the student', max_length=12, null=True, verbose_name='First Preference'), + ), + migrations.AlterField( + model_name='allocation', + name='second_pref', + field=models.CharField(blank=True, default=None, help_text='This contians the first preference caterer of the student', max_length=12, null=True, verbose_name='Second Preference'), + ), + migrations.AlterField( + model_name='allocation', + name='third_pref', + field=models.CharField(blank=True, default=None, help_text='This contians the first preference caterer of the student', max_length=12, null=True, verbose_name='Third Preference'), + ), + ] diff --git a/home/models/allocation.py b/home/models/allocation.py index fe8e74a..5495a06 100644 --- a/home/models/allocation.py +++ b/home/models/allocation.py @@ -100,7 +100,7 @@ class Allocation(models.Model): first_pref = models.CharField( _("First Preference"), default=None, - max_length=10, + max_length=12, help_text="This contians the first preference caterer of the student", null=True, blank=True, @@ -108,7 +108,7 @@ class Allocation(models.Model): second_pref = models.CharField( _("Second Preference"), default=None, - max_length=10, + max_length=12, help_text="This contians the first preference caterer of the student", null=True, blank=True, @@ -116,7 +116,7 @@ class Allocation(models.Model): third_pref = models.CharField( _("Third Preference"), default=None, - max_length=10, + max_length=12, help_text="This contians the first preference caterer of the student", null=True, blank=True,