Github user orifinkelman commented on a diff in the pull request:
https://github.com/apache/incubator-trafficcontrol/pull/434#discussion_r110540333
--- 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 --
Same as the question above on prefetch. In this case the prefetch for
"role" does not exist either, but the API still works without it and after my
change it works without prefetch for tenant table. So I am missing something on
how it works and when prefetch must be used.
---
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.
---