Edgewall Software

Opened 8 years ago

Last modified 4 years ago

#10736 new enhancement

env.get_known_users() should also return session.last_visit — at Initial Version

Reported by: lkraav <leho@…> Owned by:
Priority: normal Milestone: next-major-releases
Component: general Version: 0.12.3
Severity: normal Keywords: users, patch
Cc: osimons, Ryan J Ollos Branch:
Release Notes:
API Changes:

Description

I'm trying to build up something really lightweight to get people visible in my projects without #2456 and various hardcore tho plugins. I'd like to make use of the last_visited attribute to for example only show recently logged in people. But it turns out I gotta jump through hoops to get to it.

For example th:AccountManagerPlugin goes straight SQL here:

th:source:accountmanagerplugin/trunk/acct_mgr/api.py@11554#L277

accountmanagerplugin/trunk/acct_mgr/api.py:277:    def last_seen(self, user =
None):

In 1.0dev source:/trunk/trac/env.py@11073#618 we have:

618     def get_known_users(self, cnx=None):
619         """Generator that yields information about all known users,
620         i.e. users that have logged in to this Trac environment and
621         possibly set their name and email.
622
623         This function generates one tuple for every user, of the form
624         (username, name, email) ordered alpha-numerically by username.

Why couldn't this function also include the apparently orphanized last_visit attribute right there? Can't be a significant performance penalty, can it?

Change History (0)

Note: See TracTickets for help on using tickets.