Merge branch 'improve-assignment' into 'master'
Fix bug in assignment: date has no date See merge request bestuur/kers!6
This commit is contained in:
commit
295de3f5d5
1 changed files with 2 additions and 2 deletions
|
@ -13,7 +13,7 @@ def calc_score(user: CustomUser):
|
|||
state=EventRegistration.ADMITTED)
|
||||
score = 0
|
||||
for r in registrations_last_month:
|
||||
days_ago = (date.today() - r.event.date.date()).days
|
||||
days_ago = (date.today() - r.event.date).days
|
||||
score += 1 / (days_ago + 1)
|
||||
|
||||
return score
|
||||
|
@ -30,7 +30,7 @@ def assign_reservations(self):
|
|||
print("Assigning reservations")
|
||||
print("======================")
|
||||
# Get all events of tomorrow
|
||||
events = Event.objects.filter(date__date=date.today() + timedelta(days=1))
|
||||
events = Event.objects.filter(date=date.today() + timedelta(days=1))
|
||||
|
||||
# Reservations
|
||||
registrations: List[EventRegistration] = EventRegistration.objects.filter(
|
||||
|
|
Loading…
Reference in a new issue