Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

hotfix(backend): Fix month credit calculation on December (#8851)

Zamil Majdyd26105d38253
diff --git a/autogpt_platform/backend/backend/data/credit.py b/autogpt_platform/backend/backend/data/credit.py
index c9831694d3..a1f58dbb0b 100644
--- a/autogpt_platform/backend/backend/data/credit.py
+++ b/autogpt_platform/backend/backend/data/credit.py
@@ -70,7 +70,7 @@ class UserCredit(UserCreditBase):
async def get_or_refill_credit(self, user_id: str) -> int:
cur_time = self.time_now()
cur_month = cur_time.replace(day=1, hour=0, minute=0, second=0, microsecond=0)
- nxt_month = cur_month.replace(month=cur_month.month + 1)
+ nxt_month = cur_month.replace(month=cur_month.month % 12 + 1)
user_credit = await UserBlockCredit.prisma().group_by(
by=["userId"],