[Django]-Django 'User' object has no attribute 'user'

8👍

Your function last_seen has a bug. You were doing self.user.email which is incorrect, it should be self.email.

Also, it’s not good practice to do User.objects.filter(), because filter is used for doing lookup with conditions like sql WHERE. If you want all results, do User.objects.all().

Leave a comment