diff --git a/playlist/models/profile.py b/playlist/models/profile.py index f550bcb..a4f0457 100644 --- a/playlist/models/profile.py +++ b/playlist/models/profile.py @@ -43,11 +43,11 @@ class Profile(models.Model): def update_quota(self): elapsed = timezone.now() - self.quota_last_updated - if elapsed.seconds > 300: + if elapsed.total_seconds() > 300: noms_per_second = NOMINATIONS_PER_DAY/(60*60*24) - self.quota += noms_per_second * elapsed.seconds + self.quota += noms_per_second * elapsed.total_seconds() self.quota = min(self.quota, MAX_QUOTA) - print(f"Er zijn {elapsed.seconds}s voorbij, je nieuwe quota is {self.quota}") + print(f"{self.user.username}: Er zijn {elapsed.total_seconds()}s voorbij, je nieuwe quota is {self.quota}") self.quota_last_updated = timezone.now() @property