Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avoid entering user_logged_in when using django-su #73

Open
juancresc opened this issue Nov 11, 2020 · 1 comment
Open

avoid entering user_logged_in when using django-su #73

juancresc opened this issue Nov 11, 2020 · 1 comment

Comments

@juancresc
Copy link

Hi!

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?

@juancresc 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
@juancresc
Copy link
Author

no updates on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant