Changes between Version 2 and Version 3 of Ticket #26988


Ignore:
Timestamp:
08/02/2016 05:38:40 AM (4 years ago)
Author:
Mark Tranchant
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #26988 – Description

    v2 v3  
    33It turns out I was checking for a logged in user with {{{if request.user.is_authenticated is False:}}}, but the {{{is_authenticated}}} property is actually a {{{CallableBool}}} which cannot be tested with {{== False}}, {{is False}}, {{== True}} or {{is True}}.
    44
    5 Checking this property only gives logical results with direct {{{if user.is_authenticated}}} or {{{if not user.is_authenticated}}}. This is very misleading and non-intuitive behaviour (at odds with [https://www.python.org/dev/peps/pep-0008/#programming-recommendations PEP8 (bottom of linked section)] and should be fixed or strongly called out in the documentation. Example:
     5Checking this property only gives logical results with direct {{{if user.is_authenticated}}} or {{{if not user.is_authenticated}}}. This is very misleading and non-intuitive behaviour (at odds with [https://www.python.org/dev/peps/pep-0008/#programming-recommendations PEP8 (bottom of linked section)]) and should be fixed or strongly called out in the documentation. Example:
    66
    77{{{
Back to Top