I am trying to display a 'Log Out' link on a page that only is
displayed when a user is logged in.
When I try this link will not display when its inside the if
statement.
Anyone know how do?
Thanks in advance,
Matt
----<itemcontroller.mako>--------------
class ItemController(BaseController):
def index(self):
identity = request.environ.get('repoze.who.identity')
if identity is not None:
c.name = identity['user'].username
c.logout_button = False
else:
c.name = "Guest"
c.logout_button = True
----<item.mako>--------------
% if c.logout_button == True:
${h.link_to('Log Out', h.url('/logout_handler'))}
% endif
--
You received this message because you are subscribed to the Google Groups
"pylons-discuss" 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/pylons-discuss?hl=en.