How to check if users having a particular model extension(user profile) is authenticated

I have a django project in which I have 3 types of users (Student, Store, College) each connected to a seperate model class by One-to-one relation (not add user groups or anything) . Now I want to check if a user of a given extended model class(Student user) is authenticated or not. The aim is to redirect the (Student)user from login page directly to homepage if he is already logged in.
I tried to implement this by using:

def entry(request):
if request.user.is_authenticated:
   print("Already logged in")
   return redirect('home')
else:
    return render (request, 'tray/entry.html')

but then it’ll redirect from login to homepage even if any user from another user type(such as user of Store or College model) is authenticated, thus causing error of missing session data for rendering the student home page on this faulty redirect skipping login.
I would be very grateful if someone could suggest a way to solve this with minimum changes and also what the best practice method would be for multiple users onetoone extended models. Thanks in advance.

We’re probably going to need to see your models here. Are you using a custom User object? If so, we’ll need to see that too. Also, if you have any custom authentication views, that may be helpful.

Note, the code you posted isn’t indented properly. The if request block needs to be indented below the def entry line. When posting code here, please enclose it between lines of three backtick - ` characters. This means you’ll have a line of ```, then the code, then another line of ```. This will ensure your code stays properly formatted.