Merge pull request #1351 from jbargu/jg_add_zero_limit_to_export

Fix zero limit config on export all
This commit is contained in:
Jure Grabnar 2018-10-28 13:38:21 +01:00 committed by GitHub
commit 0977f5251d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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',