Quite a few bugs

This commit is contained in:
2023-02-27 10:30:20 -05:00
parent 86d1cf0d65
commit 6ff170e169
3 changed files with 15 additions and 17 deletions

View File

@ -6,14 +6,12 @@ from scrobbles.models import Scrobble
def now_playing(request):
user = request.user
now = timezone.now()
if user.is_authenticated:
if user.profile:
timezone.activate(pytz.timezone(user.profile.timezone))
now = timezone.localtime(timezone.now())
return {
'now_playing_list': Scrobble.objects.filter(
in_progress=True,
is_paused=False,
user=user,
)
}
if not user.is_authenticated:
return {}
return {
'now_playing_list': Scrobble.objects.filter(
in_progress=True,
is_paused=False,
user=user,
)
}