Github user orifinkelman commented on a diff in the pull request:
https://github.com/apache/incubator-trafficcontrol/pull/434#discussion_r111923046
--- Diff: traffic_ops/app/lib/API/User.pm ---
@@ -281,11 +284,14 @@ sub current {
if ( &is_ldap($self) ) {
my $role = $self->db->resultset('Role')->search( { name =>
"read-only" } )->get_column('id')->single;
+ my $user_tenant_id = $self->current_user_tenant();
+ my $user_tenant = defined($user_tenant_id) ?
$self->db->resultset('Tenant')->search( { id => $user_tenant_id }
)->get_column('name')->single : "N/A";
--- End diff --
Thanks for the clarification, understood. I was not sure because this case
is the single user (current) lookup so it should create only a single query
rather than N+1 queries. I will add the prefetch anyway.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---