Skip to content

re: Prevent Multiple Sessions for a User in your Django Application VIEW POST


I got this error 'CustomUser' object has no attribute 'logged_in_user' full trace back


Hi. I replied to your comment and YouTube but guess you deleted it.
Here you go:

The code snippet you posted has expired but from your error message, it shows you created a CustomUser model and it has no reverse relation with the LoggedInUser model.
Make sure you set the CustomUser model as the OneToOneField for user in your LoggedInUser model.

That could be the possible cause for this because i used settings.AUTH_USER_MODEL for mine. Or you could just set the AUTH_USER_MODEL to your CustomUser model in your file and your code should work as expected.

code of conduct - report abuse