From 4480bf0e290f4b633b9076a521ebd26d29a88c67 Mon Sep 17 00:00:00 2001 From: Prince Kumar Date: Sat, 17 Aug 2024 15:46:42 +0530 Subject: [PATCH] fixed error which happens on makemigrations (#64) * fix start home_period error * added error statement --- home/admin.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/home/admin.py b/home/admin.py index 9c5011b..df8f0e5 100644 --- a/home/admin.py +++ b/home/admin.py @@ -531,8 +531,11 @@ def set_period(modeladmin, request, queryset): set_period.__name__ = f'set_period_{semester_name}_{period_sno}' return set_period - for period in Period.objects.all(): - actions.append(set_period_action(period.semester.name, period.Sno)) + try: + for period in Period.objects.all(): + actions.append(set_period_action(period.semester.name, period.Sno)) + except: + print("Periods table not available") @admin.action(description="Allocate the unregistered students")