Il giorno venerdì 9 novembre 2018 11:37:23 UTC+1, Michal Petrucha ha 
scritto:

Found it. :) The error lies in the filter() call: 
>
> Thank you very much. I fixed it using  

@receiver(user_logged_in, sender=User)
def user_logged_in_callback(sender, user, request, **kwargs):
    Profile.objects.filter(user=user).exclude(date_activation__isnull=False
).update(date_activation=datetime.now())

 

> By the way, I suggest that you use django.utils.timezone.now() instead 
> of datetime.now; it's usually a good idea to use timezone-aware 
> timestamps. And side note, you need to call the function; 
>
I will try it out, thanks.

QuerySet.update doesn't accept callables. 
>
Sorry, what does it mean? 

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4b45b5f0-84d9-4a62-8fc8-6f1f9e0312ad%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to