[widgets] Fix music aggregator
This commit is contained in:
@ -86,12 +86,18 @@ def live_charts(
|
||||
app_label: str = "music",
|
||||
as_of: datetime = None,
|
||||
) -> QuerySet:
|
||||
now = as_of if as_of else timezone.now()
|
||||
tzinfo = now.tzinfo
|
||||
now = now.date()
|
||||
if user.is_authenticated and not as_of:
|
||||
now = now_user_timezone(user.profile)
|
||||
if as_of is not None:
|
||||
now = as_of
|
||||
tzinfo = now.tzinfo
|
||||
now = now.date()
|
||||
else:
|
||||
now = timezone.now()
|
||||
tzinfo = now.tzinfo
|
||||
now = now.date()
|
||||
if user.is_authenticated:
|
||||
now = now_user_timezone(user.profile)
|
||||
tzinfo = now.tzinfo
|
||||
now = now.date()
|
||||
|
||||
seven_days_ago = now - timedelta(days=7)
|
||||
thirty_days_ago = now - timedelta(days=30)
|
||||
|
||||
Reference in New Issue
Block a user