From b3668025b37e0b2ed385930607d90f128c59459f Mon Sep 17 00:00:00 2001 From: Tanner Collin Date: Wed, 11 Jan 2023 18:28:43 +0000 Subject: [PATCH] Fix usages __str__ bug --- apiserver/apiserver/api/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apiserver/apiserver/api/models.py b/apiserver/apiserver/api/models.py index 6e36e48..b83fc26 100644 --- a/apiserver/apiserver/api/models.py +++ b/apiserver/apiserver/api/models.py @@ -221,7 +221,7 @@ class Usage(models.Model): device = models.CharField(max_length=64) started_at = models.DateTimeField(auto_now_add=True) finished_at = models.DateTimeField(null=True) - deleted_at = models.DateTimeField(null=True) + deleted_at = models.DateTimeField(null=True, blank=True) num_seconds = models.IntegerField() num_reports = models.IntegerField() @@ -232,7 +232,7 @@ class Usage(models.Model): MY_FIELDS = ['started_at', 'finished_at', 'user', 'num_seconds', 'should_bill'] def __str__(self): - return self.started_at + return str(self.started_at) class PinballScore(models.Model): user = models.ForeignKey(User, related_name='scores', blank=True, null=True, on_delete=models.SET_NULL)