On Friday, May 5, 2017 at 9:44:22 AM UTC-7, RjOllos wrote:
>
>
>
> On Thursday, May 4, 2017 at 11:57:59 PM UTC-7, Roger Oberholtzer wrote:
>>
>> When doing ticket queries with the TicketQuery macro, I use
>> owner=$USER to make the list for the current user. This works great.
>>
>> So, of course, I would like to extend this type of thing to other
>> places. If possible.
>>
>> Can one access, say, the user's Full name for use an a wiki page?
>>
>
> You could write a macro in just a few lines that returns the fullname.
>
> It looks like the macro would simple return "req.session.get('name')".
>
> https://trac.edgewall.org/wiki/WikiMacros#DevelopingCustomMacros
>
> - Ryan
>
If you need to lookup the fullname for a username passed as an argument,
use:
users = env.get_known_users(as_dict=True)
fullname = users.get(username)[0]
https://trac.edgewall.org/browser/tags/trac-1.2.1/trac/env.py#L742
- Ryan
--
You received this message because you are subscribed to the Google Groups "Trac
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.