Undocumented backwards incompatible change

1 view
Skip to first unread message

SmileyChris

unread,
Dec 9, 2007, 5:55:10 PM12/9/07
to Django developers
Changeset 6299 [1] added some "useful" methods and attributes to
AnonymousUser.

One of these attributes is is_active = True

This is a change in functionality, because previously if you used
(like I was) {% if user.is_active %}, it would be only true for real
users who were active. Now it's true for unauthenticated users too.

So either the wiki should be updated or is_active should be set to
False.

Should an anonymous user be considered "active"?

[1] http://code.djangoproject.com/changeset/6299#file0

Malcolm Tredinnick

unread,
Dec 10, 2007, 7:01:13 PM12/10/07
to django-d...@googlegroups.com

On Sun, 2007-12-09 at 14:55 -0800, SmileyChris wrote:
> Changeset 6299 [1] added some "useful" methods and attributes to
> AnonymousUser.
>
> One of these attributes is is_active = True
>
> This is a change in functionality, because previously if you used
> (like I was) {% if user.is_active %}, it would be only true for real
> users who were active. Now it's true for unauthenticated users too.
>
> So either the wiki should be updated or is_active should be set to
> False.
>
> Should an anonymous user be considered "active"?

I don't feel particularly strongly either way, although I think I
probably wasn't concentrating hard enough when I committed that patch
and I suspect is_active should be False for those users (since they
cannot log in and that's the point of is_active). So I'd probably be +1
for changing is_active to False on AnonymousUser.

Malcolm

--
The sooner you fall behind, the more time you'll have to catch up.
http://www.pointy-stick.com/blog/

SmileyChris

unread,
Dec 10, 2007, 7:05:26 PM12/10/07
to Django developers
On Dec 11, 1:01 pm, Malcolm Tredinnick <malc...@pointy-stick.com>
wrote:
> I suspect is_active should be False for those users (since they
> cannot log in and that's the point of is_active). So I'd probably be +1
> for changing is_active to False on AnonymousUser.

Ok, http://code.djangoproject.com/ticket/6174
Reply all
Reply to author
Forward
0 new messages