fix: 🐛 requests

equals 0
This commit is contained in:
Stan Girard 2024-01-04 02:08:03 +01:00
parent e15d0f8774
commit 09159a2ba1
2 changed files with 2 additions and 2 deletions

View File

@ -246,7 +246,7 @@ class UserUsage(Repository):
if response and len(response) > 0:
return response[0]["daily_requests_count"]
return None
return 0
def increment_user_request_count(
self, user_id, date, current_requests_count: int, number: int = 1

View File

@ -56,7 +56,7 @@ class UserUsage(UserIdentity):
self.id, date
)
if current_requests_count is None:
if current_requests_count == 0:
if self.email is None:
raise ValueError("User Email should be defined for daily usage table")
self.supabase_db.create_user_daily_usage(