From 5d15e738661944cd5070b4a8cc4f15c1508b2e95 Mon Sep 17 00:00:00 2001 From: Mojca Lorber Date: Tue, 11 Aug 2020 13:33:44 +0200 Subject: [PATCH] Fix failing tests --- app/controllers/repository_rows_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/repository_rows_controller.rb b/app/controllers/repository_rows_controller.rb index 23e920e6e..eb969ca80 100644 --- a/app/controllers/repository_rows_controller.rb +++ b/app/controllers/repository_rows_controller.rb @@ -52,9 +52,9 @@ class RepositoryRowsController < ApplicationController def show @repository_row = RepositoryRow.find_by(id: params[:id]) - if !can_read_repository?(@repository_row.repository) || @repository_row.repository_id != params[:repository_id].to_i - return render_403 - end + return render_404 unless @repository_row + return render_404 unless @repository_row.repository_id == params[:repository_id].to_i + return render_403 unless can_read_repository?(@repository_row.repository) @assigned_modules = @repository_row.my_modules.joins(experiment: :project) @viewable_modules = @assigned_modules.viewable_by_user(current_user, current_user.teams)