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

Commit 75fe8d4

Browse files
added another api for version controlling
1 parent b2c319c commit 75fe8d4

File tree

6 files changed

+14
-6
lines changed

6 files changed

+14
-6
lines changed
0 Bytes
Binary file not shown.

Profile/urls.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,5 +74,10 @@
7474
#update the user password
7575
path('update-password', views.UpdatePasswordView.as_view(), name='update_password'),
7676

77+
#help center Api
7778
path('helpcenter', views.HelpCenterAPIView.as_view(), name='helpcenter-list'),
79+
80+
#Version Control api
81+
path("version", views.VersionCheck.as_view(), name="versionCheck")
82+
7883
]

Profile/views.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,6 @@ def put(self, request, *args, **kwargs):
518518

519519
class TransactionCreateView(APIView):
520520
authentication_classes = [TokenAuthentication]
521-
permission_classes = [IsAuthenticated]
522521

523522
def post(self, request):
524523
serializer = CreateTransactionSerializer(data=request.data)
@@ -619,6 +618,10 @@ def post(self, request):
619618

620619
return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
621620

622-
623-
624-
621+
622+
class VersionCheck(APIView):
623+
def get(self, request, *args, **kwargs):
624+
latest_version = "2.1"
625+
return Response({"message": latest_version})
626+
627+
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

rewards/views.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def get(self, request, *args, **kwargs):
137137
last_spin_time = userWheelObject.last_played_at
138138
current_time = django_timezone.now()
139139
time_since_last_spin = current_time - last_spin_time
140-
if time_since_last_spin >= timedelta(hours=6):
140+
if time_since_last_spin >= timedelta(hours=24):
141141
userWheelObject.spin_available = 1
142142
userWheelObject.save()
143143
except SpinWheel.DoesNotExist:
@@ -258,7 +258,7 @@ def get(self, request, *args, **kwargs):
258258
last_played_time = userMonsterHunterObject.last_played_at
259259
current_time = django_timezone.now()
260260
time_since_last_played = current_time - last_played_time
261-
if time_since_last_played >= timedelta(hours=6):
261+
if time_since_last_played >= timedelta(hours=12):
262262
userMonsterHunterObject.turn_available = 2
263263
userMonsterHunterObject.save()
264264
return Response({"message": str(userMonsterHunterObject.turn_available)}, status=status.HTTP_200_OK)

0 commit comments

Comments
 (0)