FAQ
I am using out of the box django 1.5 authentication solution. After
authenticated, i want to add a 'post_login_info' to the user using
user_logged_in signal from django.contrib.auth.signals

from django.contrib.auth.signals import user_logged_in
from django.dispatch import receiver

@receiver(user_logged_in)
def post_login_action(sender,user,request,**kwargs):
     user.post_login_info = 'post login info'



However, i can not retrieve user.post_login_info from request object later
as follow:

from braces.views import LoginRequiredMixin
from django.views.generic import ListView

class MyListView(LoginRequiredMixin,ListView):
     def get_queryset(self):
         self.request.user.post_login_info # Attribute Error: 'User' object
has no attribute 'post_login_info'
         ...

Thank you for any suggestion.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/596b0890-80d0-40e3-a3fb-0a5e0f30302b%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Khanh Tran at Oct 18, 2013 at 8:28 pm
    Even though i have not directly answered my question, i found out that
    session storage is an alternative solution.
    On Friday, October 18, 2013 12:17:50 PM UTC-7, Khanh Tran wrote:

    I am using out of the box django 1.5 authentication solution. After
    authenticated, i want to add a 'post_login_info' to the user using
    user_logged_in signal from django.contrib.auth.signals

    from django.contrib.auth.signals import user_logged_in
    from django.dispatch import receiver

    @receiver(user_logged_in)
    def post_login_action(sender,user,request,**kwargs):
    user.post_login_info = 'post login info'



    However, i can not retrieve user.post_login_info from request object later
    as follow:

    from braces.views import LoginRequiredMixin
    from django.views.generic import ListView

    class MyListView(LoginRequiredMixin,ListView):
    def get_queryset(self):
    self.request.user.post_login_info # Attribute Error: 'User'
    object has no attribute 'post_login_info'
    ...

    Thank you for any suggestion.
    --
    You received this message because you are subscribed to the Google Groups "Django users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
    To post to this group, send email to django-users@googlegroups.com.
    Visit this group at http://groups.google.com/group/django-users.
    To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/6aed9fdd-3829-44e1-bac2-320948ffc3c5%40googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupdjango-users @
categoriesdjango, python
postedOct 18, '13 at 7:17p
activeOct 18, '13 at 8:28p
posts2
users1
websitedjangoproject.com

1 user in discussion

Khanh Tran: 2 posts

People

Translate

site design / logo © 2022 Grokbase