diff --git a/app/controllers/api/v2/infrastructures_controller.rb b/app/controllers/api/v2/infrastructures_controller.rb index 5e5e0a3f..fba65051 100644 --- a/app/controllers/api/v2/infrastructures_controller.rb +++ b/app/controllers/api/v2/infrastructures_controller.rb @@ -149,10 +149,11 @@ def profile_by_cluster_name def profile_by_app_group_name @app_group = AppGroup.find_by( - name: params[:app_group_name] + name: params[:app_group_name], + status: "ACTIVE" ) - if @app_group.blank? || !@app_group.ACTIVE? + if @app_group.blank? render(json: { success: false, errors: ['App Group not found'], diff --git a/app/controllers/api/v3/infrastructures_controller.rb b/app/controllers/api/v3/infrastructures_controller.rb index 179dcfe0..2bf8ae96 100644 --- a/app/controllers/api/v3/infrastructures_controller.rb +++ b/app/controllers/api/v3/infrastructures_controller.rb @@ -138,9 +138,10 @@ def authorize_by_username def profile_by_app_group_name @app_group = AppGroup.find_by( name: params[:app_group_name], + status: "ACTIVE" ) - if @app_group.blank? || !@app_group.ACTIVE? + if @app_group.blank? render(json: { success: false, errors: ['App Group not found'],