fix(aurora): fixed a dangerous-default-value pylint warning in database.mysql_log()

This commit is contained in:
Seaswimmer 2024-02-28 11:01:33 -05:00
parent 84543fbd73
commit 95a947b019
Signed by untrusted user: cswimr
GPG key ID: B8953EC01E5C4063

View file

@ -8,7 +8,8 @@ from discord import Guild
from redbot.core import data_manager from redbot.core import data_manager
from .logger import logger from .logger import logger
from .utils import convert_timedelta_to_str, generate_dict, get_next_case_number from .utils import (convert_timedelta_to_str, generate_dict,
get_next_case_number)
def connect() -> sqlite3.Connection: def connect() -> sqlite3.Connection:
@ -118,9 +119,9 @@ async def mysql_log(
resolved_by: str = None, resolved_by: str = None,
resolved_reason: str = None, resolved_reason: str = None,
expired: bool = None, expired: bool = None,
changes: list = [], changes: list = None,
metadata: dict = {}, metadata: dict = None,
) -> int: # pylint: disable=dangerous-default-value ) -> int:
if not timestamp: if not timestamp:
timestamp = int(time.time()) timestamp = int(time.time())
@ -169,8 +170,8 @@ async def mysql_log(
resolved_by, resolved_by,
resolved_reason, resolved_reason,
expired, expired,
json.dumps(changes), json.dumps(changes if changes else []),
json.dumps(metadata), json.dumps(metadata if metadata else {}),
) )
cursor.execute(sql, val) cursor.execute(sql, val)