You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to log user log in date using something like this:
from django.contrib.auth.signals import user_logged_in
def set_last_seen(sender, user, request, **kwargs):
if not len(request.session.get("exit_users_pk", default=[])):
user.profile.last_seen = timezone.now()
user.profile.save()
user_logged_in.connect(set_last_seen)
But looks like exit_users_pk is being populated after the signal is sent, cause it's always empty.
Is there a way we can check in this signal if the login is triggered by django-su?
The text was updated successfully, but these errors were encountered:
juancresc
changed the title
how to avoid entering user_logged_in when using django-su
avoid entering user_logged_in when using django-su
Nov 11, 2020
Hi!
I want to log user log in date using something like this:
But looks like exit_users_pk is being populated after the signal is sent, cause it's always empty.
Is there a way we can check in this signal if the login is triggered by django-su?
The text was updated successfully, but these errors were encountered: