From 6e3166967efcdde868280d4c82f1315d4285dd76 Mon Sep 17 00:00:00 2001 From: abutalib-kiwi Date: Thu, 5 Oct 2023 13:07:42 +0530 Subject: [PATCH] fixed login into another device issue --- account/views.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/account/views.py b/account/views.py index 45e662e..b240e44 100644 --- a/account/views.py +++ b/account/views.py @@ -114,6 +114,10 @@ class GoogleLoginMixin(object): ERROR_CODE["2069"], response_status=status.HTTP_400_BAD_REQUEST ) + device_detail, created = UserDeviceDetails.objects.get_or_create(user=user_data.last()) + if device_detail: + device_detail.device_id = device_id + device_detail.save() return custom_response(SUCCESS_CODE['3003'], serializer.data, response_status=status.HTTP_200_OK) @@ -202,6 +206,10 @@ class SigninWithApple(views.APIView): ERROR_CODE["2069"], response_status=status.HTTP_400_BAD_REQUEST ) + device_detail, created = UserDeviceDetails.objects.get_or_create(user=user) + if device_detail: + device_detail.device_id = device_id + device_detail.save() return custom_response(SUCCESS_CODE['3003'], serializer.data, response_status=status.HTTP_200_OK)