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)
|
state=EventRegistration.ADMITTED)
|
||||||
score = 0
|
score = 0
|
||||||
for r in registrations_last_month:
|
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)
|
score += 1 / (days_ago + 1)
|
||||||
|
|
||||||
return score
|
return score
|
||||||
|
@ -30,7 +30,7 @@ def assign_reservations(self):
|
||||||
print("Assigning reservations")
|
print("Assigning reservations")
|
||||||
print("======================")
|
print("======================")
|
||||||
# Get all events of tomorrow
|
# 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
|
# Reservations
|
||||||
registrations: List[EventRegistration] = EventRegistration.objects.filter(
|
registrations: List[EventRegistration] = EventRegistration.objects.filter(
|
||||||
|
|
Loading…
Reference in a new issue