First time poster here,
I'm currently working on some unit tests of my Django app, and I'm running into a issue with is_authenticated.
I'm using Django 1.11.16 and Django CMS 3.5.2.
While trying to work with Django CMS menus, I get:
File "/usr/local/lib/python3.6/site-packages/menus/menu_pool.py", line 243, in get_renderer
return MenuRenderer(pool=self, request=request)
File "/usr/local/lib/python3.6/site-packages/menus/menu_pool.py", line 107, in __init__
self.draft_mode_active = use_draft(request)
File "/usr/local/lib/python3.6/site-packages/cms/utils/moderator.py", line 5, in use_draft
is_staff = (request.user.is_authenticated() and request.user.is_staff)
TypeError: 'property' object is not callable
Looking at the documentation, this should be fine.
https://docs.djangoproject.com/en/1.11/ref/contrib/auth/#attributes
Trying this in a shell:
./run.sh manage shell
Python 3.6.6 (default, Sep 12 2018, 02:15:29)
[GCC 6.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from django.contrib.auth.models import AnonymousUser
>>> AnonymousUser.is_authenticated
<property object at 0x7fb8c93878b8>
>>> bool(AnonymousUser.is_authenticated)
True
>>> AnonymousUser.is_authenticated()
Traceback (most recent call last):
File "<console>", line 1, in <module>
TypeError: 'property' object is not callable
None of that seems right. Have I somehow managed to get something else pulled in?
In the actual application, not-logged in users see the right stuff, so apparently there it's working.
Stefan
--
Stefan Bethke <
s...@lassitu.de> Fon
+49 151 14070811