fix(aurora): change how Moderation.update() works
This commit is contained in:
parent
557ac45fcc
commit
0b697f9f50
1 changed files with 1 additions and 2 deletions
|
@ -81,11 +81,10 @@ class Moderation(AuroraGuildModel):
|
||||||
from aurora.utilities.database import connect
|
from aurora.utilities.database import connect
|
||||||
from aurora.utilities.json import dumps
|
from aurora.utilities.json import dumps
|
||||||
query = f"UPDATE moderation_{self.guild_id} SET timestamp = ?, moderation_type = ?, target_type = ?, moderator_id = ?, role_id = ?, duration = ?, end_timestamp = ?, reason = ?, resolved = ?, resolved_by = ?, resolve_reason = ?, expired = ?, changes = ?, metadata = ? WHERE moderation_id = ?;"
|
query = f"UPDATE moderation_{self.guild_id} SET timestamp = ?, moderation_type = ?, target_type = ?, moderator_id = ?, role_id = ?, duration = ?, end_timestamp = ?, reason = ?, resolved = ?, resolved_by = ?, resolve_reason = ?, expired = ?, changes = ?, metadata = ? WHERE moderation_id = ?;"
|
||||||
changes = [change.to_json() for change in self.changes]
|
|
||||||
|
|
||||||
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(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), dumps(self.metadata), self.moderation_id))
|
||||||
cursor.close()
|
cursor.close()
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|
Loading…
Reference in a new issue