fix(aurora): use pydantic basemodels instead of the Moderation model
Some checks failed
Actions / Build Documentation (MkDocs) (pull_request) Successful in 34s
Actions / Lint Code (Ruff & Pylint) (pull_request) Failing after 51s

This commit is contained in:
Seaswimmer 2024-05-04 15:33:49 -04:00
parent 98f3e5943b
commit ca7c0d8d7c
Signed by: cswimr
GPG key ID: 5D671B5D03D65A7F

View file

@ -1,7 +1,7 @@
import json import json
from datetime import datetime, timedelta from datetime import datetime, timedelta
from aurora.models import Moderation from pydantic import BaseModel
class JSONEncoder(json.JSONEncoder): class JSONEncoder(json.JSONEncoder):
@ -10,7 +10,7 @@ class JSONEncoder(json.JSONEncoder):
return int(o.timestamp()) return int(o.timestamp())
if isinstance(o, timedelta): if isinstance(o, timedelta):
return str(o) return str(o)
if isinstance(o, Moderation): if isinstance(o, BaseModel):
return o.model_dump() return o.model_dump()
return super().default(o) return super().default(o)