Skip to content

Commit

Permalink
fixed error which happens on makemigrations (#64)
Browse files Browse the repository at this point in the history
* fix start home_period error

* added error statement
  • Loading branch information
Princekumarofficial authored Aug 17, 2024
1 parent 743f13c commit 4480bf0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions home/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 4480bf0

Please sign in to comment.