Skip to content

Commit

Permalink
fix tz
Browse files Browse the repository at this point in the history
  • Loading branch information
= committed Sep 5, 2024
1 parent b3d8a57 commit 6c35671
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions auctions/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import re
from collections import Counter
from datetime import datetime, timedelta
from datetime import timezone as date_tz
from io import BytesIO, TextIOWrapper
from random import randint, sample, uniform
from urllib.parse import unquote, urlencode
Expand Down Expand Up @@ -2098,8 +2099,8 @@ def get_context_data(self, **kwargs):
self.request,
"This auction is still in progress, check back once it's finished for more complete stats",
)
if self.get_object().date_posted < timezone.make_aware(
datetime(year=2024, month=1, day=1, tzinfo=datetime.timezone.utc)
if self.get_object().date_posted < datetime(
year=2024, month=1, day=1, tzinfo=date_tz.utc
):
messages.info(self.request, "Not all stats are available for old auctions.")
return context
Expand Down Expand Up @@ -5447,9 +5448,7 @@ def get_context_data(self, **kwargs):
.count()
)
invoiceqs = (
Invoice.objects.filter(
date__gte=datetime(2021, 6, 15, tzinfo=datetime.timezone.utc)
)
Invoice.objects.filter(date__gte=datetime(2021, 6, 15, tzinfo=date_tz.utc))
.filter(seller_invoice__winner__isnull=False)
.distinct()
)
Expand Down

0 comments on commit 6c35671

Please sign in to comment.