From cab0b78afa1a7ae0d577b82e59d3cc6e7f0b0be2 Mon Sep 17 00:00:00 2001 From: Jure Grabnar Date: Sun, 28 Oct 2018 09:43:34 +0100 Subject: [PATCH] Fix zero limit config on export all --- app/controllers/teams_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/teams_controller.rb b/app/controllers/teams_controller.rb index 2c51b9382..a73aec2a5 100644 --- a/app/controllers/teams_controller.rb +++ b/app/controllers/teams_controller.rb @@ -229,8 +229,8 @@ class TeamsController < ApplicationController if export_projects_params[:project_ids] # Check if user has enough requests for the day limit = (ENV['EXPORT_ALL_LIMIT_24_HOURS'] || 3).to_i - if limit.zero? \ - || current_user.export_vars['num_of_export_all_last_24_hours'] >= limit + if !limit.zero? \ + && current_user.export_vars['num_of_export_all_last_24_hours'] >= limit render json: { html: render_to_string( partial: 'projects/export/error.html.erb',