WIP: Refactor Aurora (3.0.0) #29
1 changed files with 2 additions and 2 deletions
|
@ -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)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue