In my case, I store the instance of the User class along with some
other information. If the user is logged in, I used request.user to
get the instance and store it. The problem happens when the user is
Anonymous.

I finally fixed the problem by checking if the user is authenticated
and setting the instance of the User class to None.


Ravi


On Apr 6, 9:26 am, Karen Tracey <[email protected]> wrote:
> On Mon, Apr 5, 2010 at 3:32 PM, zenr <[email protected]> wrote:
> >  In my application, I used django-registration to allow users to
> > login. Authenticated users can use all features of the site while
> > Anonymous user should be able to use some portion of the site. When
> > django makes a request for an authenticated user, it creates a
> > request.user object that is derived from django's User class, while
> > the same for non-authenticated user is Anonymous user class.
>
> >  The problem I am facing is that these two classes are different but
> > my model can only handle instance of User class. Hence it works for
> > authenticated users but not for Anonymous users!!
>
> Why, specifically, can your code only handle User class instances? Fixing
> that would seem to get you past this hurdle.
>
> Karen

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to