Skip to content
This repository was archived by the owner on Aug 29, 2023. It is now read-only.

Commit c8ebcf4

Browse files
Solved a bug in DailyCheckIn Func
1 parent 1cca938 commit c8ebcf4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed
-40 Bytes
Binary file not shown.

rewards/views.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@ def post(self, request, **kwargs):
9292
last_claimed = RecentEarnings.objects.filter(
9393
user=user, way_to_earn='Daily Check-In').order_by('-created_at').first()
9494

95-
if last_claimed and last_claimed.created_at > (timezone.now() - timedelta(hours=24)).date():
96-
# User has already claimed the award in the last 24 hours
97-
return Response({'message': 'You have already claimed the award in the last 24 hours.'}, status=400)
95+
if last_claimed and last_claimed.created_at >= timezone.now().date():
96+
# User has already claimed the award today
97+
return Response({'message': 'You have already claimed the award today.'}, status=400)
9898

9999
# Add the points to the user's account
100100
user_wallet = Wallet.objects.get(user=user)

0 commit comments

Comments
 (0)