Skip to content

Commit

Permalink
logging adjustments and formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
DMcP89 committed Aug 30, 2024
1 parent 7b03198 commit 964a4c2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions harambot/database/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@
KEY = settings.HARAMBOT_KEY
else:
from cryptography.fernet import Fernet

fernet_key = Fernet.generate_key()
KEY = fernet_key.decode()


class BaseModel(Model):
class Meta:
database = database
Expand Down
6 changes: 6 additions & 0 deletions harambot/services/reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,13 @@ def poll_transactions(guild: Guild):
transactions = YahooAPI.get_transactions(
timestamp=ts.timestamp(), guild_id=guild.guild_id
)
logger.info(
"Found {} transactions for guild {}".format(
str(len(transactions)), guild.guild_id
)
)
if transactions:

for transaction in transactions:
embed = embed_functions_dict[transaction["type"]](transaction)
webhook = SyncWebhook.from_url(
Expand Down
1 change: 0 additions & 1 deletion harambot/yahoo_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ def handle_oauth(f):
@functools.wraps(f)
def wrapper(self, *args, **kwargs):
guild_id = kwargs.get("guild_id")
logger.info("SET YAHOO WRAPPER Interaction: {}".format(guild_id))
guild = Guild.get_or_none(Guild.guild_id == str(guild_id))
if guild is None:
logger.error(
Expand Down

0 comments on commit 964a4c2

Please sign in to comment.