Skip to content

Commit

Permalink
QR: update allocation for every period
Browse files Browse the repository at this point in the history
  • Loading branch information
Princekumarofficial committed Nov 17, 2024
1 parent 4fa2324 commit 502eab5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions qrscan/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit 502eab5

Please sign in to comment.