From 1bd4c5be52a4011adaa08b1befe93c430bf8df8d Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Sun, 31 May 2020 18:26:21 +0300 Subject: [PATCH] Send the login signal on login. --- django_etesync/views.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/django_etesync/views.py b/django_etesync/views.py index e73d567..ece894b 100644 --- a/django_etesync/views.py +++ b/django_etesync/views.py @@ -16,7 +16,7 @@ import json from functools import reduce from django.conf import settings -from django.contrib.auth import get_user_model +from django.contrib.auth import get_user_model, user_logged_in from django.core.exceptions import PermissionDenied from django.db import transaction, IntegrityError from django.db.models import Max, Q @@ -654,6 +654,9 @@ class AuthenticationViewSet(viewsets.ViewSet): return Response({'code': 'login_bad_signature'}, status=status.HTTP_400_BAD_REQUEST) data = self.login_response_data(user) + + user_logged_in.send(sender=user.__class__, request=request, user=user) + return Response(data, status=status.HTTP_200_OK) return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)