fix(aurora): strip and replace the json dumps before inserting them into the db
This commit is contained in:
parent
0b697f9f50
commit
04d10d2cf8
1 changed files with 17 additions and 1 deletions
|
@ -84,7 +84,23 @@ class Moderation(AuroraGuildModel):
|
||||||
|
|
||||||
with connect() as database:
|
with connect() as database:
|
||||||
cursor = database.cursor()
|
cursor = database.cursor()
|
||||||
cursor.execute(query, (self.timestamp, self.moderation_type, self.target_type, self.moderator_id, self.role_id, self.duration, self.end_timestamp, self.reason, self.resolved, self.resolved_by, self.resolve_reason, self.expired, dumps(self.changes), dumps(self.metadata), self.moderation_id))
|
cursor.execute(query, (
|
||||||
|
self.timestamp,
|
||||||
|
self.moderation_type,
|
||||||
|
self.target_type,
|
||||||
|
self.moderator_id,
|
||||||
|
self.role_id,
|
||||||
|
self.duration,
|
||||||
|
self.end_timestamp,
|
||||||
|
self.reason,
|
||||||
|
self.resolved,
|
||||||
|
self.resolved_by,
|
||||||
|
self.resolve_reason,
|
||||||
|
self.expired,
|
||||||
|
dumps(self.changes).strip('"').replace('\\"', '"'),
|
||||||
|
dumps(self.metadata).strip('"').replace('\\"', '"'),
|
||||||
|
self.moderation_id
|
||||||
|
))
|
||||||
cursor.close()
|
cursor.close()
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|
Loading…
Reference in a new issue