Closed chrisvans closed 11 years ago
So... If you sign up as a barista, then you log out, and then log back in, it will correctly -always- recognize you as a barista. If not, you will have to sign up as a barista every time you click on the barista tab, and then check in from there. Weird. Checking login and testing some things...
So the issue would appear to be that we are looking at the session 'user' which keys to the user object we stored there at the time of login. We need to re-store ( in the session ) the current user that is saved once we change userType to 'Barista'. The problem is, the only way I know to reload the user object so that we can store it in the session, is authenticate(). If we could search for the user object by username, then it would be easy. Authenticate requires us to re-submit the password, which I don't think is possible on our end.
Ha, wait, we can just set the current user to the session user... of course. There should be a better way of doing this through django's login, but I don't know how yet.
Alright... fixed.
hahaha loved reading this exchange with yourself.
When your userType is already defined as 'Barista', you shouldn't be able to sign up as a barista. The page also shouldn't prompt you to sign up as a barista each time - you should see the locations with check in buttons instead.