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

Commit 931f1e9

Browse files
Logic changes made to the verifyPin method
1 parent 3a43fbc commit 931f1e9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Profile/views.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,9 @@ def post(self, request, format=None):
165165
user.is_active = True
166166
user.save()
167167
return Response({'message': 'Pin verified successfully'}, status=status.HTTP_200_OK)
168+
elif timezone.now() > verify_pin_obj.created_at + timezone.timedelta(minutes=5):
169+
user.delete()
170+
return Response({"message":"The Pin Is Expired Please Signup Again"})
168171
else:
169172
return Response({'message': 'Invalid or expired PIN'}, status=status.HTTP_400_BAD_REQUEST)
170173
except ResetPassword.DoesNotExist:

0 commit comments

Comments
 (0)