From 7411b65ac9c4044a4bca983e64cca9efd1182daa Mon Sep 17 00:00:00 2001 From: Pancham Agarwal Date: Tue, 12 Dec 2023 04:15:35 +0530 Subject: [PATCH] Add Settings object initialization --- apps/nightpass/views.py | 1 + apps/users/management/commands/check_defaulters.py | 1 + 2 files changed, 2 insertions(+) diff --git a/apps/nightpass/views.py b/apps/nightpass/views.py index 02b46ff..89aafad 100644 --- a/apps/nightpass/views.py +++ b/apps/nightpass/views.py @@ -16,6 +16,7 @@ from datetime import datetime, date, timedelta +Settings = Settings.objects.first() @login_required def campus_resources_home(request): diff --git a/apps/users/management/commands/check_defaulters.py b/apps/users/management/commands/check_defaulters.py index 64d05b0..4a06341 100644 --- a/apps/users/management/commands/check_defaulters.py +++ b/apps/users/management/commands/check_defaulters.py @@ -4,6 +4,7 @@ from datetime import date, timedelta, datetime, time from django.utils import timezone +Settings = Settings.objects.first() def check_defaulters(): previous_day_nightpasses = NightPass.objects.filter(date=date.today()-timedelta(days=1))