Github user mitchell852 commented on a diff in the pull request:

    
https://github.com/apache/incubator-trafficcontrol/pull/644#discussion_r124597615
  
    --- Diff: traffic_ops/app/lib/API/Tenant.pm ---
    @@ -121,7 +115,12 @@ sub update {
                }       
        }       
     
    -   if ( !defined( $params->{parentId}) && !$self->isRootTenant($id) ) {
    +   my $tenant_utils = UI::TenantUtils->new($self);
    +   my $tenants_data = $tenant_utils->create_tenants_data_from_db(undef);
    +
    --- End diff --
    
    how about right here adding something like:
    
    if ( is_root_tenant($tenants_data, $id) ) {
                return $self->alert("Root tenant cannot be updated.");
        }
    
    I think we agreed that the root tenant can't be updated but I could be 
wrong. Anyhow, if you put this code right about here, then you won't have to 
check is_root_tenant() anymore in this function which I think will make your 
code easier to read.
    



---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to