Coverage for lino/modlib/users/utils.py : 90%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
# Copyright 2011-2015 Luc Saffre # License: BSD (see file COPYING for details)
.. autosummary::
"""
"""A singleton class whose instance will be assigned to the :attr:`user` attribute of anonymous incoming requests, similar to Django's approach.
See also :attr:`lino.core.site.Site.anonymous_user_profile`.
""" """This is always `False`. See also :attr:`lino.modlib.users.models.User.authenticated`. """
def instance(cls): # Call startup() to fill UserProfiles also in a # multi-threaded environment: settings.SITE.anonymous_user_profile, None) raise Exception( "Invalid value %r for `SITE.anonymous_user_profile`. " "Must be one of %s" % ( settings.SITE.anonymous_user_profile, [i.value for i in list(UserProfiles.items())]))
return self.username
# 20131022 AttributeError at /api/outbox/MyOutbox : 'AnonymousUser' # object has no attribute 'get_typed_instance' return self |