fix(aurora): fixed a valueerror
Some checks failed
Actions / Build Documentation (MkDocs) (pull_request) Successful in 30s
Actions / Lint Code (Ruff & Pylint) (pull_request) Failing after 47s

This commit is contained in:
Seaswimmer 2024-06-04 16:55:29 -04:00
parent ff34310113
commit ce48c1e889
Signed by: cswimr
GPG key ID: 5D671B5D03D65A7F

View file

@ -30,7 +30,7 @@ class Change(AuroraBaseModel):
def from_dict(cls, bot: Red, data: dict) -> "Change": def from_dict(cls, bot: Red, data: dict) -> "Change":
if isinstance(data, str): if isinstance(data, str):
data = json.loads(data) data = json.loads(data)
if "duration" in data and data["duration"] and not isinstance(data["duration"], timedelta): if "duration" in data and data["duration"] and not isinstance(data["duration"], timedelta) and not data["duration"] == "NULL":
hours, minutes, seconds = map(int, data["duration"].split(':')) hours, minutes, seconds = map(int, data["duration"].split(':'))
duration = timedelta(hours=hours, minutes=minutes, seconds=seconds) duration = timedelta(hours=hours, minutes=minutes, seconds=seconds)
elif "duration" in data and isinstance(data["duration"], timedelta): elif "duration" in data and isinstance(data["duration"], timedelta):