fix(aurora): pylint fixes
This commit is contained in:
parent
0d64e3f652
commit
027144f35d
3 changed files with 7 additions and 6 deletions
|
@ -116,7 +116,7 @@ class ImportAuroraView(ui.View):
|
||||||
database=database,
|
database=database,
|
||||||
return_obj=False
|
return_obj=False
|
||||||
)
|
)
|
||||||
except Exception as e:
|
except Exception as e: # pylint: disable=broad-exception-caught
|
||||||
failed_cases.append(str(case["moderation_id"]) + f": {e}")
|
failed_cases.append(str(case["moderation_id"]) + f": {e}")
|
||||||
|
|
||||||
await interaction.edit_original_response(content="Import complete.")
|
await interaction.edit_original_response(content="Import complete.")
|
||||||
|
|
|
@ -299,7 +299,7 @@ class Moderation(AuroraGuildModel):
|
||||||
changes: list | None = None,
|
changes: list | None = None,
|
||||||
metadata: dict | None = None,
|
metadata: dict | None = None,
|
||||||
return_obj: bool = True,
|
return_obj: bool = True,
|
||||||
) -> Union["Moderation", None]:
|
) -> Union["Moderation", int]:
|
||||||
from ..utilities.database import connect
|
from ..utilities.database import connect
|
||||||
from ..utilities.json import dumps
|
from ..utilities.json import dumps
|
||||||
if not timestamp:
|
if not timestamp:
|
||||||
|
@ -325,7 +325,7 @@ class Moderation(AuroraGuildModel):
|
||||||
if reason == "NULL":
|
if reason == "NULL":
|
||||||
reason = None
|
reason = None
|
||||||
|
|
||||||
if resolved_by == "NULL" or resolved_by == '?':
|
if resolved_by in ["NULL", "?"]:
|
||||||
resolved_by = None
|
resolved_by = None
|
||||||
|
|
||||||
if resolved_reason == "NULL":
|
if resolved_reason == "NULL":
|
||||||
|
@ -393,3 +393,4 @@ class Moderation(AuroraGuildModel):
|
||||||
|
|
||||||
if return_obj:
|
if return_obj:
|
||||||
return cls.find_by_id(bot=bot, moderation_id=moderation_id, guild_id=guild_id)
|
return cls.find_by_id(bot=bot, moderation_id=moderation_id, guild_id=guild_id)
|
||||||
|
return moderation_id
|
||||||
|
|
|
@ -199,10 +199,10 @@ def timedelta_from_string(string: str) -> timedelta:
|
||||||
hours, minutes, seconds = map(int, string.split(":"))
|
hours, minutes, seconds = map(int, string.split(":"))
|
||||||
return timedelta(hours=hours, minutes=minutes, seconds=seconds)
|
return timedelta(hours=hours, minutes=minutes, seconds=seconds)
|
||||||
|
|
||||||
def timedelta_to_string(timedelta: timedelta) -> str:
|
def timedelta_to_string(td: timedelta) -> str:
|
||||||
"""Converts a timedelta object to a string."""
|
"""Converts a timedelta object to a string."""
|
||||||
days = timedelta.days * 24
|
days = td.days * 24
|
||||||
hours, remainder = divmod(timedelta.seconds, 3600)
|
hours, remainder = divmod(td.seconds, 3600)
|
||||||
minutes, seconds = divmod(remainder, 60)
|
minutes, seconds = divmod(remainder, 60)
|
||||||
return f"{days + hours}:{minutes:02}:{seconds:02}"
|
return f"{days + hours}:{minutes:02}:{seconds:02}"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue