Project

General

Profile

Revision 67225dc7

Added by Thomas McKay almost 5 years ago

fixes #17698 - no longer raise error in matches_by_quantity

View differences:

lib/hammer_cli_csv/utils/subscriptions.rb
168 168

  
169 169
        if !subs_quantity.nil? && !subs_quantity.empty? && subs_quantity != 'Automatic'
170 170
          subs_quantity = subs_quantity.to_i
171
          refined = matches.select do |subscription|
171
          matches.select! do |subscription|
172 172
            subscription['available'] == -1 || subs_quantity <= subscription['available']
173 173
          end
174
          raise _("No '%{name}' subscription with quantity %{quantity} or more available") %
175
            {:name => matches[0]['name'], :quantity => subs_quantity} if refined.empty?
176
          matches = refined
177 174
        end
178 175
        debug_subscriptions("matches_by_quantity: #{subs_quantity}", matches)
179 176
        matches

Also available in: Unified diff