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

Commit 234b238

Browse files
Solved a fucking str bug in the codebase causing crash
1 parent 8cc0a25 commit 234b238

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed
37 Bytes
Binary file not shown.

rewards/views.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def get(self, request):
145145
spin_wheel.save()
146146

147147
# Return the current spin availability for the user
148-
return Response({'spin_available': spin_wheel.spin_available}, status=status.HTTP_200_OK)
148+
return Response({'spin_available': str(spin_wheel.spin_available)}, status=status.HTTP_200_OK)
149149

150150

151151
# noinspection PyMethodMayBeStatic
@@ -160,7 +160,7 @@ def post(self, request):
160160
spin_wheel.spin_available += 1
161161
spin_wheel.save()
162162

163-
return Response({'spin_available': spin_wheel.spin_available}, status=status.HTTP_200_OK)
163+
return Response({'spin_available': str(spin_wheel.spin_available)}, status=status.HTTP_200_OK)
164164

165165

166166
# noinspection PyMethodMayBeStatic
@@ -180,7 +180,7 @@ def get(self, request):
180180
tt_object.turn_available = 10
181181
tt_object.save()
182182

183-
return Response({'turn_available': tt_object.turn_available}, status=status.HTTP_200_OK)
183+
return Response({'turn_available': str(tt_object.turn_available)}, status=status.HTTP_200_OK)
184184

185185

186186
# noinspection PyMethodMayBeStatic
@@ -257,7 +257,7 @@ def get(self, request):
257257
monster_hunter_object.turn_available = 2
258258
monster_hunter_object.save()
259259

260-
return Response({'turn_available': monster_hunter_object.turn_available}, status=status.HTTP_200_OK)
260+
return Response({'turn_available': str(monster_hunter_object.turn_available)}, status=status.HTTP_200_OK)
261261

262262

263263
# noinspection PyMethodMayBeStatic
@@ -399,7 +399,7 @@ def calculate_turns_available(self, quiz_obj):
399399
quiz_obj.turn_available = 1
400400
quiz_obj.save()
401401

402-
return quiz_obj.turn_available
402+
return str(quiz_obj.turn_available)
403403

404404

405405
# Function related to automating the quiz section

0 commit comments

Comments
 (0)