From 502eab5cf1b6da849b0c852a9a17e14c25a7f4da Mon Sep 17 00:00:00 2001 From: princekumarofficial Date: Sun, 17 Nov 2024 14:23:51 +0530 Subject: [PATCH] QR: update allocation for every period --- qrscan/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qrscan/views.py b/qrscan/views.py index 28ed0c3..664e953 100644 --- a/qrscan/views.py +++ b/qrscan/views.py @@ -26,9 +26,9 @@ def mess_card(request): mess_card, _ = MessCard.objects.get_or_create(student=student) if(not mess_card.allocation): - setattr(mess_card, allocation) + setattr(mess_card, "allocation", allocation) mess_card.save() - elif((mess_card.allocation != allocation) and allocation.period.end_date < timezone.localtime().date()): + elif((mess_card.allocation != allocation) and mess_card.allocation.period.end_date < timezone.localtime().date()): setattr(mess_card, "allocation", allocation) mess_card.save()