I'm just being curious here but in what scenario would you have multiple 
people logging in at the same time using the same computer/browser?


On Thursday, February 11, 2016 at 1:30:21 PM UTC+1, Aakash Tewari wrote:
>
> Hello
>
>
> Here is new one I guess. 
>
> We have 3 types of users say A, B, C. All have 3 different login pages on 
> same domain. We have extended User model by OneToOne relationship like this
>
> class AModel(models.Model):
>     users = models.OneToOneField(User, on_delete=models.CASCADE)
>     is_A = models.NullBooleanField(default=False)
>
> class BModel(models.Model):
>     users = models.OneToOneField(User, on_delete=models.CASCADE)
>     is_B = models.NullBooleanField(default=False)
>
>
> class BModel(models.Model):
>     users = models.OneToOneField(User, on_delete=models.CASCADE)
>     is_B = models.NullBooleanField(default=False)
>
>
> Now During login we check like this :
>
> username=request.POST.get('username','')
> password=request.POST.get('pass','')
> user = authenticate(username=username, password=password)
> u = AModel.objects.get(users=user)
> if user is not None:
>    if user.is_active and u.isA:
>       login(request, user)
>       return HttpResponseRedirect("/home/")
>
> same way for B and C
>
>
>
> Now issue is when A login session is set and everything works fine, but when 
> user B logins, session for user A is removed. 
>
> How can we allow 3 user 3 tabs 3 diff(login and home page)  on same browser
>
>
> Thanks 
>
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
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/064e44d3-c541-470d-91de-c481faf3a7c6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to