fix(aurora): don't JSON serialize the Red class
Some checks failed
Actions / Build Documentation (MkDocs) (pull_request) Successful in 22s
Actions / Lint Code (Ruff & Pylint) (pull_request) Failing after 31s

This commit is contained in:
Seaswimmer 2024-05-04 20:55:11 -04:00
parent a22de1d2c2
commit 3f6aec0a82
Signed by: cswimr
GPG key ID: 5D671B5D03D65A7F

View file

@ -1,6 +1,9 @@
import json import json
from datetime import datetime, timedelta from datetime import datetime, timedelta
from redbot.core.bot import Red
from aurora.models import AuroraBaseModel from aurora.models import AuroraBaseModel
@ -12,6 +15,8 @@ class JSONEncoder(json.JSONEncoder):
return str(o) return str(o)
if isinstance(o, AuroraBaseModel): if isinstance(o, AuroraBaseModel):
return o.to_json() return o.to_json()
if isinstance(o, Red):
return None
return super().default(o) return super().default(o)