On 22 May 2012 22:58, Kurtis Mullins <kurtis.mull...@gmail.com> wrote: > Sorry I'm a bit confused so I'm going to try to make some sense of > your situation "out loud" :) > > 1. User.objects.get(username="some_username") works some-times
Yes. > 2. When it doesn't work, then you get the DoesNotExist exception, right? Yes. > 3. If not, what error(s) do you see? I haven't tried it on non-existing users. I except to get a user back. > 4. Are you sure the user, with that username, does exist when you get > the exception? Yes. The user exists if I do an objects.all() or startswith/endswith. I can do User.objects.get(id=... and get the user I want, i just can't look em up by username. > 5. If you are sure they exist and you still get the exception, did you > look into the database itself to see if it exists? Or how did you come > to this conclusion? In a view I run User.objects.gte() by hand, then the user exists, then a handful of lines later, still in the same view, User.objects.get() for the same user is run by authenticate() (default ModelBackend) but then the user does not exist. The database does not change in the meantime. The odd thing is it's only the auth.User model that shows this. Other models are fine. HM -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.