[templates] Clean up dashboard
This commit is contained in:
@ -4,6 +4,7 @@ import logging
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
import pendulum
|
||||
from pendulum.parsing.exceptions import ParserError
|
||||
import pytz
|
||||
from django.apps import apps
|
||||
from django.contrib import messages
|
||||
@ -115,8 +116,11 @@ class RecentScrobbleList(ListView):
|
||||
month = today.month
|
||||
day = today.day
|
||||
if date:
|
||||
year, month, day = date.split("-")
|
||||
data["date"] = pendulum.parse(date)
|
||||
try:
|
||||
data["date"] = pendulum.parse(date)
|
||||
year, month, day = date.split("-")
|
||||
except:
|
||||
pass
|
||||
|
||||
data = data | Scrobble.for_day_dict(user_id, year, month, day)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user