Skip to content

Commit

Permalink
fix: More patreon debug
Browse files Browse the repository at this point in the history
  • Loading branch information
db0 committed Feb 29, 2024
1 parent 922108a commit d8b6eaf
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions horde/classes/base/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,7 @@ def modify_monthly_kudos(self, monthly_kudos):
self.modify_kudos(monthly_kudos, "recurring")
if not self.monthly_kudos_last_received:
self.monthly_kudos_last_received = datetime.utcnow()
logger.info(f"Last received date set to {self.monthly_kudos_last_received}")
self.monthly_kudos += monthly_kudos
if self.monthly_kudos < 0:
self.monthly_kudos = 0
Expand All @@ -647,7 +648,8 @@ def receive_monthly_kudos(self, force=False, prevent_date_change=False):
has_month_passed = True
if has_month_passed:
logger.info(
f"Preparing to assign {kudos_amount} monthly kudos to {self.get_unique_alias()}. Current total {self.kudos}",
f"Preparing to assign {kudos_amount} monthly kudos to {self.get_unique_alias()}. "
f"Current total: {self.kudos}. Last received date: {self.monthly_kudos_last_received}",
)
# Not committing as it'll happen in modify_kudos() anyway
if not self.monthly_kudos_last_received:
Expand All @@ -656,7 +658,8 @@ def receive_monthly_kudos(self, force=False, prevent_date_change=False):
self.monthly_kudos_last_received = self.monthly_kudos_last_received + dateutil.relativedelta.relativedelta(months=+1)
self.modify_kudos(kudos_amount, "recurring")
logger.info(
f"User {self.get_unique_alias()} received their {kudos_amount} monthly Kudos. Their new total is {self.kudos}",
f"User {self.get_unique_alias()} received their {kudos_amount} monthly Kudos. "
f"Their new total is {self.kudos} and the last received date set to {self.monthly_kudos_last_received}",
)

def calculate_monthly_kudos(self):
Expand Down

0 comments on commit d8b6eaf

Please sign in to comment.