From 7e18f55b00d54ad61de5672ddfc88039163af612 Mon Sep 17 00:00:00 2001 From: Laurent Date: Tue, 9 Jul 2024 11:20:05 +0200 Subject: [PATCH] Fix missing device_id attribution --- api/views.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/api/views.py b/api/views.py index bc4a09d..9fa736e 100644 --- a/api/views.py +++ b/api/views.py @@ -29,6 +29,9 @@ class CustomAuthToken(APIView): if user is not None: if user.device_id is None or user.device_id == device_id: + user.device_id = device_id + user.save() + token, created = Token.objects.get_or_create(user=user) return Response({'token': token.key}) else: